Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: push foreach glob - bug?

by ikegami (Patriarch)
on Jan 13, 2010 at 22:56 UTC ( #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? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-09-29 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?