CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [digioleg54] I am loosing value of my argument: Edit Log



FishMonger
Veteran / Moderator

Jul 19, 2016, 5:58 PM


Views: 14927
Re: [digioleg54] I am loosing value of my argument


In Reply To
Can I ask you in a different way.
my $que = pop(ARGV); it gives 3.
How can I put $que into $args->{queue}?


2 options:

Code
$args->{queue} = $que;

or

Code
$args->{queue} = \$que;


Those 2 statements have slightly different effects/results.

The first one copies the current value of $que and the 2nd one creates a reference to the $que var. If you use the 2nd example, if $que is altered after that assignment, then so too will the value of $args->{queue} change since it's a reference to the $que var.


(This post was edited by FishMonger on Jul 19, 2016, 6:02 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Jul 19, 2016, 5:59 PM
Post edited by FishMonger (Veteran) on Jul 19, 2016, 6:02 PM
Post edited by FishMonger (Veteran) on Jul 19, 2016, 6:02 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives