$sites = "one-seven-three-four-nine"; @site_list = split(/-/,$sites # array is a bad array name foreach $site ( @site_list ) { # assuming you've got something more in mind # than print "$site\n"; if ( $site eq "three" ) { print "we got a three\n"; } if ( $site eq "seven" ) { .... } # foreach $site
a
In reply to Re: Parsing Arrays
by a
in thread Parsing Arrays
by jasmine
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |