Discard words until we see the "A" marker : Array Value « Array « Perl

Home
Perl
1.Array
2.CGI
3.Class
4.Data Type
5.Database
6.File
7.GUI
8.Hash
9.Language Basics
10.Network
11.Regular Expression
12.Report
13.Statement
14.String
15.Subroutine
16.System Functions
17.Win32
18.XML
Perl » Array » Array Value 
Discard words until we see the "A" marker
    


#!/usr/bin/perl
use warnings;
use strict;

my @lines = ("C""B""A""E""D");

while (my $line = shift @lines) {
    last if $line eq 'A';
}

print "@lines";

   
    
    
    
  
Related examples in the same category
1.Change value in an array
2.Sum values in an array
3.Totalling a List
4.A program that copies an array and compares the elements of the two arrays.
5.A program that assigns a list as part of another list.
6.Determine the mean
7.Empty list
8.Filling an array with 100 zeroes by using the 'x' operator
9.Filling an array with a sequence of numbers by using the '..' operator
10.Reference Counting and Destruction
11.Mix data type in an array
12.Accessing Elements: Populating an array and printing its values
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.