Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Array got modified!

by Anonymous Monk
on Oct 10, 2011 at 13:00 UTC ( #930619=note: print w/replies, xml ) Need Help??


in reply to Re^4: Array got modified!
in thread Array got modified!

$ perl -MO=Deparse junk print "Before: @x$/"; use File::Glob (); while (defined(my $ele = glob(join $", @x))) { do { next unless $ele; print "$ele becomes "; $ele =~ s/^(.)/x$1/; print $ele . $/ }; } print "$/After: @x"; __DATA__ junk syntax OK

See glob, readline

Replies are listed 'Best First'.
Re^6: Array got modified!
by exilepanda (Pilgrim) on Oct 10, 2011 at 13:19 UTC
    Sorry but I don't get it.

    First, after a perldoc on the glob, I get totally lost, I never touch a Unix shell, so I couldn't imagine or relate to anything.. I am on Win32 all time..

    Second, would you explain more for what is your code try to demonstrate? Is this a safe/suggested way to do what I want? or it's proving my way is danger? or anything else ?

      Second, would you explain more for what is your code try to demonstrate?

      Um, its your code run through B::Deparse

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930619]
help
Chatterbox?
Discipulus loose the tozzetto party!
[shmem]: .oO( addition of cookies for addiction to cookies )
[Lady_Aleena]: Other than my typos shmem. 8)
[shmem]: otherwise fine
[Discipulus]: tozzetti & vinsanto
[Lady_Aleena]: The whole line is push @line, ref($list_addition ) ? @$list_addition : $list_addition if $list_addition;
[Lady_Aleena]: And I forgot to do the array check, I'm such a doofus today.
[Lady_Aleena]: push @line, ref($list_addition ) eq 'ARRAY' ? @$list_addition : $list_addition if $list_addition; #trying again
[shmem]: Discipulus: yummy. I like those. Didn't have them for some time now, forgot the name. Should go get some...
[shmem]: Lasy_Aleena: correct, although for clarity I'd use an if() block, not a statement modifier

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-04-27 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (504 votes). Check out past polls.