Re: 2 questions please, one on scope and one on regex

2008-12-22 Thread John W. Krahn
Eric Krause wrote: Hello all, Hello, I have two quick questions that I would love some help on. I have looked at the manual (Programming Perl) and I didn't get it, hence my email. Question 1 - How can I make variables in a function (subroutine) global (accessible from other functions)? A

Re: 2 questions please, one on scope and one on regex

2008-12-22 Thread Mr. Shawn H. Corey
On Mon, 2008-12-22 at 15:18 -0700, Eric Krause wrote: > Hello all, > I have two quick questions that I would love some help on. I have looked > at the manual (Programming Perl) and I didn't get it, hence my email. > > Question 1 - How can I make variables in a function (subroutine) global > (acc

2 questions please, one on scope and one on regex

2008-12-22 Thread Eric Krause
Hello all, I have two quick questions that I would love some help on. I have looked at the manual (Programming Perl) and I didn't get it, hence my email. Question 1 - How can I make variables in a function (subroutine) global (accessible from other functions)? Question 2 - I am trying to con

Re: 2 questions

2002-04-02 Thread Eric Plowe
sheesh - that's a lot easier then the way I do it :P thanks. ~Eric On Tuesday, April 2, 2002, at 07:09 PM, John W. Krahn wrote: > Glenn Cannon wrote: >> >> Hi all, > > Hello, > >> Couple of questions from a newbie... >> >> 1) How can I print the current directory name? > > use Cwd; > my $dir =

Re: 2 questions

2002-04-02 Thread John W. Krahn
Glenn Cannon wrote: > > Hi all, Hello, > Couple of questions from a newbie... > > 1) How can I print the current directory name? use Cwd; my $dir = cwd; print "The current directory is $dir\n"; > 2) How can I check to see if a file I know the name of exists? if ( -e $filename ) { pri

RE: 2 questions

2002-04-02 Thread Timothy Johnson
PROTECTED] Subject: Re: 2 questions Glenn.. to print the current directory name...try --- #!/usr/bin/perl -w use strict; use Cwd; $curr = cwd(); print "$curr\n"; easy enough this is bit longer example.. you could prolly do it another way..but this is how *I* would do it --- #!/usr/b

Re: 2 questions

2002-04-02 Thread Eric Plowe
Glenn.. to print the current directory name...try --- #!/usr/bin/perl -w use strict; use Cwd; $curr = cwd(); print "$curr\n"; easy enough this is bit longer example.. you could prolly do it another way..but this is how *I* would do it --- #!/usr/bin/perl -w use strict; use Cwd; my $cur

2 questions

2002-04-02 Thread Glenn Cannon
Hi all, Couple of questions from a newbie... 1) How can I print the current directory name? 2) How can I check to see if a file I know the name of exists? Thx, Glenn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: 2 questions

2002-01-29 Thread Curtis Poe
--- Naveen Parmar <[EMAIL PROTECTED]> wrote: > 1) How do you define global & lexical variables in Perl? > 2) Is the arrow (->) a commonly used Perl operator? > > TIA, > - NP Global variables may be defined in several different manners. 1. Fully qualified with package name: package Foo;

RE: 2 questions

2002-01-29 Thread Hanson, Robert
ule that acts like an object). Rob -Original Message- From: Naveen Parmar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 5:40 PM To: [EMAIL PROTECTED] Subject: 2 questions 1) How do you define global & lexical variables in Perl? 2) Is the arrow (->) a commonly used

2 questions

2002-01-29 Thread Naveen Parmar
1) How do you define global & lexical variables in Perl? 2) Is the arrow (->) a commonly used Perl operator? TIA, - NP _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAI

RE: 2 Questions

2002-01-14 Thread McCollum, Frank
} -Original Message- From: Naveen Parmar [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 2:51 PM To: [EMAIL PROTECTED] Subject: 2 Questions 1) Double clicking my Perl file within Windows Explorer opens within the DOS window, but then closes immediately after executio

RE: 2 Questions

2002-01-14 Thread Dean Theophilou
:34 PM To: Naveen Parmar; [EMAIL PROTECTED] Subject: RE: 2 Questions > 1) Double clicking my Perl file within Windows Explorer opens within the DOS > window, but then closes immediately after execution. > > It flashes up on the screen and closes itself. Can I prevent this auto &

RE: 2 Questions

2002-01-14 Thread Gary Hawkins
> 1) Double clicking my Perl file within Windows Explorer opens within the DOS > window, but then closes immediately after execution. > > It flashes up on the screen and closes itself. Can I prevent this auto > termination? `pause`; or: system "pause"; Although pause is not documented in eithe

2 Questions

2002-01-14 Thread Naveen Parmar
1) Double clicking my Perl file within Windows Explorer opens within the DOS window, but then closes immediately after execution. It flashes up on the screen and closes itself. Can I prevent this auto termination? 2) Is there any difference between using the following within Perl scripts? ""

Re: 2 questions on perl.

2001-10-18 Thread Brett W. McCoy
On Thu, 18 Oct 2001, Amit Joshi wrote: > Q1: Do we have a standard way to generate random numbers in perl ? perldoc -f rand perldoc -q random > Q2: How do we run system commands from a perl program ? perldoc -f system perldoc -q system (perldoc -f gives you information on the usage of a speci

2 questions on perl.

2001-10-18 Thread Amit Joshi
Hi, I'm very new to perl. Have following two questions: Q1: Do we have a standard way to generate random numbers in perl ? Q2: How do we run system commands from a perl program ? Thanks and regards, Amit. _ Get your FREE downl