Re: Returning variables from sub routines.

2004-07-23 Thread jason corbett
Your correct. Actually I was trying to pass that variable back when it was local to the sub routine instead of assigning it to a variable outside the routine i.e $process_data2=dateme( ); where process_data2 is either global or assigned as my OUTSIDE that particular routine. Thanks, JC Flemm

Re: Returning variables from sub routines.

2004-07-23 Thread Flemming Greve Skovengaard
jason corbett wrote: I have a sub routine that I created called dateme. when i run the sub routine, I am getting errors that Global symbol "$process_date" requires explicit package name at What gives? Thanks, JC Here is the snipet #---called from dateme( ); #

Returning variables from sub routines.

2004-07-23 Thread jason corbett
I have a sub routine that I created called dateme. when i run the sub routine, I am getting errors that Global symbol "$process_date" requires explicit package name at What gives? Thanks, JC Here is the snipet #---called from dateme( ); #--- sub dateme{ my

RE: Returning variables

2003-07-28 Thread Dan Muey
Howdy all! Thanks for everyone who gave suggestions on this. I'm ending up doing hash since it seems the best way to do what I want: my %x; for(100..1,2) { $x{$_} = "... $_"; } print "$x{1978} $x{57} Howdy!"; Thanks all! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Returning variables

2003-07-28 Thread david
Dan Muey wrote: >> You've got it, only, don't return anything. >> >> Here is a command-line example: >> >>perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"' >> >> This is basically exactly what you have there. It's not >> supposed to "return" variables, but rather "create" var

Re: Returning variables

2003-07-28 Thread Steve Grazzini
On Mon, Jul 28, 2003 at 03:23:10PM -0500, Dan Muey wrote: > That what I'd say also except here I'm using a series of > numbers for(100..1000) { } Each one has the same string > except the number is different And then want to just declare > them all with one call and use them as I want. Nope.

RE: Returning variables

2003-07-28 Thread Bob Showalter
Dan Muey wrote: > Howdy list! > > I was wondering if it's possible to run a funtion and have it set a > bunch of variables. > > As in variables I didn't declare before. Yes, but don't do it. > > #/usr/bin/perl -w > > use strict; > > makevars(); # declares, and gives a value to $one $two $

Re: Returning variables

2003-07-28 Thread Casey West
It was Monday, July 28, 2003 when Dan Muey took the soap box, saying: : > You've got it, only, don't return anything. : > : > Here is a command-line example: : > : >perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"' : > : > This is basically exactly what you have there. It's no

RE: Returning variables

2003-07-28 Thread Dan Muey
> You've got it, only, don't return anything. > > Here is a command-line example: > >perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"' > > This is basically exactly what you have there. It's not > supposed to "return" variables, but rather "create" variables. > > Just a note

Returning variables

2003-07-28 Thread Dan Muey
Howdy list! I was wondering if it's possible to run a funtion and have it set a bunch of variables. As in variables I didn't declare before. #/usr/bin/perl -w use strict; makevars(); # declares, and gives a value to $one $two $three print "$one $two $three"; I could have it return a ref