Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: push foreach glob - bug?

by ikegami (Patriarch)
on Jan 13, 2010 at 22:56 UTC ( [id://817300]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -wle'my @f = glob("*.mp3"); push @{$f[/ad/]}, $_ forea
    +ch @f;'
    Can't use string ("bar.mp3") as an ARRAY ref while "strict refs" in us
    +e at -e line 1.
    
  2. or download this
    $ perl -le '@f = glob("*.mp3"); push @{$f[/ad/]}, $_ foreach @f; use D
    +ata::Dumper; print Dumper(\@f, \@{"bad.mp3"}, \@{"bar.mp3"})'
    $VAR1 = [
    ...
    $VAR3 = [
              'bad.mp3'
            ];
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://817300]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found