Re: Style ( was:Capture a printing function into an array )

2003-06-16 Thread Harry Putnam
"Charles K. Clarkson" <[EMAIL PROTECTED]> writes: > > $$line =~ s/[Ss]ource/Src/g; > $$line =~ s/[Dd]estination/Dst/g; > $$line =~ /^[^ ]+, (\d[^ ]+ \d[^ ]+).*(Src[^ ]+ \d+).*(Dst[^ ]+ Where do I look for the details on the meaning of the double `$'? -- To unsubscribe,

Re: while (<>)

2003-06-16 Thread Mark G
- Original Message - From: "Bryan Harris" <[EMAIL PROTECTED]> To: "Beginners Perl" <[EMAIL PROTECTED]> Sent: Tuesday, June 17, 2003 1:33 AM Subject: Re: while (<>) > > > #!/usr/bin/perl > > > > my $showme = shift > > or die "Usage: $0 [FILES]\n"; > > > > while (defined(my $lin

Re: Capture a printing function into an array

2003-06-16 Thread Mark G
- Original Message - From: "Harry Putnam" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 17, 2003 1:35 AM Subject: Re: Capture a printing function into an array > Mark G <[EMAIL PROTECTED]> writes: > > > I am a newbie as well but this line makes no sence to me why do yo

Re: switch user

2003-06-16 Thread Ahmed Moustafa
Steve Grazzini wrote: Ahmed Moustafa <[EMAIL PROTECTED]> wrote: [ That address is bouncing, by the way. ] It should not! What was the message that you got? How can I switch user "su" in perl? It's much easier to do that before running the script. :-) $ su -c ./script.pl And then once you'

Re: Style ( was:Capture a printing function into an array )

2003-06-16 Thread Harry Putnam
"Charles K. Clarkson" <[EMAIL PROTECTED]> writes: > Sorry Harry. This reply doesn't answer your question. > But your subroutine raises some excellent reasons why a > better defined programming style can save keystrokes and > headaches later on. God knows I can use stylistic advice... thanks.

Re: Capture a printing function into an array

2003-06-16 Thread Harry Putnam
Mark G <[EMAIL PROTECTED]> writes: > I am a newbie as well but this line makes no sence to me why do you have > ($line = $line) ??? >> ($line = $line) =~ s/[Dd]estination/Dst/g; It began life as: $line =~ s/[Dd]estination/Dst/g; Which is sufficient, but in the course of doggedly c

Re: while (<>)

2003-06-16 Thread Bryan Harris
> #!/usr/bin/perl > > my $showme = shift > or die "Usage: $0 [FILES]\n"; > > while (defined(my $line = <>)) { > $_ .= $line; > next unless eof; # [1] > > my $prefix = ($ARGV eq '-')? '' : "$ARGV: "; # [2] > > print "${prefix}$1\n" while /(

Multi-Dimensional Hashes.

2003-06-16 Thread Tirthankar C. Patnaik
Folks, This may be a naive query, but dashed if I know it. I have a large dataset, of financial data, and I need to check the results of some trading strategies on it. I have read the data into a hash of hashes of hashes, as I believe it's better than read this into an array (Or

Re: Capture a printing function into an array

2003-06-16 Thread Mark G
- Original Message - From: "Harry Putnam" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 11:47 PM Subject: Capture a printing function into an array > > My script has a function that I want to just print its output in some > circumstances but in others I need to

Re: switch user

2003-06-16 Thread Steve Grazzini
Ahmed Moustafa <[EMAIL PROTECTED]> wrote: [ That address is bouncing, by the way. ] > How can I switch user "su" in perl? It's much easier to do that before running the script. :-) $ su -c ./script.pl And then once you're root, you can change the real and effective user ids with the magic $

Style ( was:Capture a printing function into an array )

2003-06-16 Thread Charles K. Clarkson
Harry Putnam wrote: : : My script has a function that I want to just print its : output in some circumstances but in others I need to : capture its output into an array for further processing: : : sub strip_to_bone { :if(/[Ss]ource/ && /[Dd]estination/){ : ($line = $line) =~ s/[Ss]our

Re: while (<>)

2003-06-16 Thread Steve Grazzini
On Mon, Jun 16, 2003 at 09:05:40PM -0700, Bryan Harris wrote: > > I'm writing a program ("showme") similar to grep, where the user > sends data and a pattern (possibly spanning multiple lines), and > the script tells what file the pattern is found in, and what it > found. Very simple. If it w

Re: while (<>)

2003-06-16 Thread Bryan Harris
Is there a way to discover the filename of the current file being read when using the angle brackets (e.g. while (<>) {} )? >>> [stuff cut out] > > Bottom line, <> won't help you! > > I can think of ways of piping through ARGV but, really, you don't > want to go there - believe me. >

Capture a printing function into an array

2003-06-16 Thread Harry Putnam
My script has a function that I want to just print its output in some circumstances but in others I need to capture its output into an array for further processing: sub strip_to_bone { if(/[Ss]ource/ && /[Dd]estination/){ ($line = $line) =~ s/[Ss]ource/Src/g; ($line = $line) =~

switch user

2003-06-16 Thread Ahmed Moustafa
How can I switch user "su" in perl? Thanks in advance, Ahmed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

send e-mail with html integrated with xml (the html file missing)

2003-06-16 Thread Josimar Nunes de Oliveira
The html file wasn´t sent together and its content is: Thanks, Josimar

send e-mail with html integrated with xml

2003-06-16 Thread Josimar Nunes de Oliveira
Hello everybody, Although this problem seems to be related to "html" with "xml" and "e-mail",  I´d like to build a code to write and send an e-mail with two combined parts: html and xml. My problem is to understand how to join the two files into one e-mail and the result must be visualized a

RE: Problem with the Unix 'du' command via perl script

2003-06-16 Thread jandrspencer
-Original Message- From: jandrspencer [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 7:31 PM To: [EMAIL PROTECTED] Subject: RE: Problem with the Unix 'du' command via perl script Hello, Tony. Try something like: #!/usr/bin/perl -w use strict; my($size) = `du -sb \/home\/`

RE: Is empty directory?

2003-06-16 Thread Charles K. Clarkson
John W. Krahn <[EMAIL PROTECTED]> wrote: : : > From: "Charles K. Clarkson" <[EMAIL PROTECTED]> : : > > sub IsEmptyDir { [snip] : > > return $count ? 0 : 1; : : You could just return $count; which will do the right thing. We are testing for an empty condition. When the count is 0 the fu

Re: Is empty directory?

2003-06-16 Thread Jair Santos
I am using notepad as my editor . My code is like this: if (IsEmptyDir($directory) = = 0 ) { $message = "The directory $directory is empty"; system( "k:\\psgdev\\design\\tools\\writestatus $STATUSDBF E \"$message\"") && die "Unable to write to $S

RE: Is empty directory?

2003-06-16 Thread Jason . Santos
Sure: W:\>type test.pl sub IsDir { return 1 } if ( IsDir() = = 1 ) { print "true" } else { print "false" } W:\>perl test.pl syntax error at test.pl line 2, near "= =" Execution of test.pl aborted due to compilation errors. W:\>perl -v This is perl, v5.8.0 built for MSWin32-x86-m

Re: Problem with the Unix 'du' command via perl script

2003-06-16 Thread Tony Frasketi
Hello Dan Thanks for the response. I tried your suggestion but I still get the differing sizes... So I'm still looking for a solution. Thanks again Tony Frasketi Dan Muey wrote: > > > I'm having a problem with the results of the Unix 'du' > > command in that I get different results when I execu

Re: Is empty directory?

2003-06-16 Thread John W. Krahn
Jair Santos wrote: > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > Jair Santos wrote: > > > > > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > > > > > > $ perl -le' > > > > sub IsDir { return 1 } > > > > if ( IsDir() = = 1 ) { print "true" } > > > > else { print "false" } >

Re: Is empty directory?

2003-06-16 Thread Jair Santos
ActivePerl 5.8 - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 3:41 PM Subject: Re: Is empty directory? > Jair Santos wrote: > > > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > > > > $ perl -le' > > > sub IsDir {

Re: Is empty directory?

2003-06-16 Thread John W. Krahn
Jair Santos wrote: > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > > $ perl -le' > > sub IsDir { return 1 } > > if ( IsDir() = = 1 ) { print "true" } > > else { print "false" } > > ' > > syntax error at -e line 3, near "= =" > > Execution of -e aborted due to compilation errors

Re: [Re: Windows command line Search and Replace]

2003-06-16 Thread John W. Krahn
Greg Carrara wrote: > > Thanks for the response! However, when I try this > perl -pi -e "s/wordToFind/replaceWithThisWord/gi" *.ext > with ActivePerl 5.6.1, on Windows 2000, I receive the error: > > CAN'T DO IN PLACE EDIT WITHOUT BACKUP > > Could this have something to do with Perl not reading

RE: [Re: Windows command line Search and Replace]

2003-06-16 Thread Bakken, Luke
> Thanks for the response! However, when I try this > perl -pi -e "s/wordToFind/replaceWithThisWord/gi" *.ext > with ActivePerl 5.6.1, on Windows 2000, I receive the error: > > CAN'T DO IN PLACE EDIT WITHOUT BACKUP > > Could this have something to do with Perl not reading from > and writing to

Re: [Re: Windows command line Search and Replace]

2003-06-16 Thread GREG CARRARA
>"Jenda Krynicky" <[EMAIL PROTECTED]> wrote: >>From: GREG CARRARA <[EMAIL PROTECTED]> >> Hello, >> I'm trying to search for a word and replace it multiple files at a >> windows command prompt with the following: >> >> perl -pi -e 's/wordToFind/replaceWithThisWord/gi'*.fileExtension >> >> This e

RE: Problem with the Unix 'du' command via perl script

2003-06-16 Thread Dan Muey
> I'm having a problem with the results of the Unix 'du' > command in that I get different results when I execute the > 'du' command from the Unix command line... > >du -sb > > and when I execute the 'du' command from a Perl script using > backtic statement. > >my($size) = `du -sb `

Re: Is empty directory?

2003-06-16 Thread Jair Santos
Is it a DOS or UNIX box ? Mine is DOS and it works. - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 2:57 PM Subject: Re: Is empty directory? > Jair Santos wrote: > > > > > That is because "= =" is a syntax error, it sho

Re: Is empty directory?

2003-06-16 Thread John W. Krahn
Jair Santos wrote: > > > That is because "= =" is a syntax error, it should be "==" with no > > whitespace between the two equals signs. Since the expression is in a > > boolean context the "== 0" part can be omitted and it will do the same > > thing. > > Thats ok, but it was NOT a sintax error.

Re: Mult-idimensional associative arrays

2003-06-16 Thread John W. Krahn
Mark In The Netherlands wrote: > > Hello all, Hello, > I am hoping that someone can help me out with my syntax regarding the use of > associative arrays. Let's suppose that I create the following object: > > my %family = ( > 'mark' => { > "tim" => {"sex","male","age","16"}, >

Re: Is empty directory?

2003-06-16 Thread Jair Santos
> That is because "= =" is a syntax error, it should be "==" with no > whitespace between the two equals signs. Since the expression is in a > boolean context the "== 0" part can be omitted and it will do the same > thing. Thats ok, but it was NOT a sintax error. The script was running properly w

Problem with the Unix 'du' command via perl script

2003-06-16 Thread Tony Frasketi
I'm having a problem with the results of the Unix 'du' command in that I get different results when I execute the 'du' command from the Unix command line... du -sb and when I execute the 'du' command from a Perl script using backtic statement. my($size) = `du -sb `; However the differin

Re: Is empty directory?

2003-06-16 Thread John W. Krahn
Jair Santos wrote: > > From: "Charles K. Clarkson" <[EMAIL PROTECTED]> > > > Jair Santos [mailto:[EMAIL PROTECTED] wrote: > > : > > : I am using the following snippet of code to > > : check if the directory is empty : and it is > > : working. > > : > > : sub IsEmptyDir { > > : > > : my ( $dir

Mult-idimensional associative arrays

2003-06-16 Thread Mark Troyer
Hello all, I am hoping that someone can help me out with my syntax regarding the use of associative arrays. Let's suppose that I create the following object: my %family = ( 'mark' => { "tim" => {"sex","male","age","16"}, "tracy" => {"sex","female","age","12"},

Re: perl process management

2003-06-16 Thread Lance
Thanks for that! I use Perl on both Windows and Linux boxes. I sort of played around with fork() but did not understand the advantages of fork, until you mentioned them. Truly, the drag on resources having to spawn a bunch of processes was killing any PC I was putting it on. I did sort of do my

Re: examples of place holders

2003-06-16 Thread Robin Norwood
"Johnson, Shaunn" <[EMAIL PROTECTED]> writes: > --thanks for the reply. > > --i see the same example in the Perldoc for DBI, > --but what i don't see is if i can substitute: > > > >>> $sth->execute('Bill', 32); > > with something like this: > > >>> $sth->execute ('select tableowner from t_tab

compiling DBD::Oracle

2003-06-16 Thread Robert Citek
Hello all, What would I need in order to write a perl script to query an Oracle database? I have written perl scripts to connect to MySQL and PostgreSQL databases. In those cases, both the databases and the scripts were run on Red Hat Linux v7.1/2. This time, I am trying to write a perl script

Mult-idimensional associative arrays

2003-06-16 Thread Mark in the Netherlands
Hello all, I am hoping that someone can help me out with my syntax regarding the use of associative arrays. Let's suppose that I create the following object: my %family = ( 'mark' => { "tim" => {"sex","male","age","16"}, "tracy" => {"sex","female","age","12"},

Re: Is empty directory?

2003-06-16 Thread Jair Santos
Thanks Charles, as a begginer I am having some problems to understand this compact code perl let us write. In my script I was testing like this if (IsEmptyDir($directory) = = 0) and, when I included the new code you suggested, it didn work. Then I removed the = = 0 and started to work. Could

RE: examples of place holders

2003-06-16 Thread Dan Muey
> --thanks for the reply. > > --i see the same example in the Perldoc for DBI, > --but what i don't see is if i can substitute: > > > >>> $sth->execute('Bill', 32); $sth->execute($dbh->selectrow_array('select tableowner from t_table')); I havn't trested this but it should because "Bill" and "32

RE: examples of place holders

2003-06-16 Thread Johnson, Shaunn
--thanks for the reply. --i see the same example in the Perldoc for DBI, --but what i don't see is if i can substitute: >>> $sth->execute('Bill', 32); with something like this: >>> $sth->execute ('select tableowner from t_table'); and have the results from that be put in place of '?'. --bu

Re: examples of place holders

2003-06-16 Thread Robin Norwood
"Johnson, Shaunn" <[EMAIL PROTECTED]> writes: > Howdy: > > Can someone give me an example of using > place holders with the DBI module? > > I am trying to use the results of one query > and embed that into another query later. For > example: the result of the first query > (say, select distinct

RE: Mial::Mailer Date Stamp and Error Handling using SMTP Service

2003-06-16 Thread Smith Jeff D
That addresses the first part--even though I didn't install the new 5.8 module yet, changing the date string format to the new RFC standard format before sending it off to the mailer changes the date/timestamp on the message correctly. Anyone have a better approach toward error-trapping the res

RE: Mial::Mailer Date Stamp and Error Handling using SMTP Service

2003-06-16 Thread Smith Jeff D
Thanks, I'll try it. But I'll have to go to 5.8 from 5.6, which Activestate has advised against since the Windows 5.8 is so buggy. I'll try it and let you know. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 3:38 PM To: [EMAIL PROTECTED] Su

examples of place holders

2003-06-16 Thread Johnson, Shaunn
Howdy: Can someone give me an example of using place holders with the DBI module? I am trying to use the results of one query and embed that into another query later. For example: the result of the first query (say, select distinct user_name from t_table) should go into the second (say select ta

Re: Is empty directory?

2003-06-16 Thread Paul Johnson
On Mon, Jun 16, 2003 at 10:59:45AM -0700, John W. Krahn wrote: > Jair Santos wrote: > > Can anybody explain whats the use of the = ( ) = ? > > But perl has a shortcut that allows you to assign a list to () which in > scalar context returns the number of elements in the list without having > to

Re: Backup utility (was RE: concatonate to file?)

2003-06-16 Thread Mark G
> #make the archive: > `tar -cvzf $targetpath $files`; This to can be write in perl. perldoc -m Archive::Tar perldoc -m Compress::Zlib - Original Message - From: "West, William M" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 3:08 PM Subject: Backup utility (w

Re: Mial::Mailer Date Stamp and Error Handling using SMTP Service

2003-06-16 Thread John W. Krahn
Smith Jeff D wrote: > > I was wondering if someone could point me in the right direction for > using the Mail::Mailer module. I have two questions: > > I have a simple script to mail log files to systems administrators using > Mail::Mailer --that works fine as it is. > > 1. Date/Times

Re: Backup utility (was RE: concatonate to file?)

2003-06-16 Thread John W. Krahn
William M West wrote: > > # still unclear about '-w' verses 'use warnings' The warnings pragma was introduced in Perl5 for lexically scoped warnings. In other words you can turn warnings on or off inside a limited scope. while ( <> ) { # turn off "other" warnings inside this while loop

Re: checking a reg exp

2003-06-16 Thread John W. Krahn
"John W. Krahn" wrote: > > You could do something like this: > > # setup fundcode hash > my %fundcodes; > @fundcodes{ @fundcodes } = (); > > while ( my $temp = ) { > print "$.\n"; > chomp; Sorry, that should be: chomp $temp; > for my $field ( split /\|/, $temp ) { >

Re: checking a reg exp

2003-06-16 Thread John W. Krahn
Tim McGeary wrote: > > Greetings, Hello, > I am a new subscriber and I do know a little perl, but I am trying to > pick up a lot more very quickly. I am having an issue with a conditional > checking a regular expression > that doesn't make sense and every book or online resource I have found > s

Mial::Mailer Date Stamp and Error Handling using SMTP Service

2003-06-16 Thread Smith Jeff D
I was wondering if someone could point me in the right direction for using the Mail::Mailer module. I have two questions: I have a simple script to mail log files to systems administrators using Mail::Mailer --that works fine as it is. 1. Date/Timestamp modification: But I notice that

RE: system function

2003-06-16 Thread Dan Muey
> > exec("sendscript.pl"); > > print "Couldn't start sendscript.pl Error: $!\n"; Oh yeah... What is the out put of ls -l in that directory? Is it .cgi and not .pl? Is it spelled wrong? (IE It is actually SendScript.pl) Try a ./ in front since that is what you'd have to type in to execute it. Or

Backup utility (was RE: concatonate to file?)

2003-06-16 Thread West, William M
#!/usr/bin/perl -w #simple tar archiver... something to make a cron job with #in the future :) #thanks for the info for strftime :) now can parse system time and #use it use POSIX qw(strftime); # still unclear about '-w' verses 'use warnings' use strict; use diagnostics; # where to put the a

RE: checking a reg exp

2003-06-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Tim McGeary wrote: > Greetings, > > I am a new subscriber and I do know a little perl, but I am trying to > pick up a lot more very quickly. I am having an issue with a > conditional checking a regular expression > that doesn't make sense and every book or online resource I have found > shows the

Re: Is empty directory?

2003-06-16 Thread John W. Krahn
Tim Johnson wrote: > > I think you can also do it this way if it makes more sense (someone correct > me if I'm wrong, I can't test this here): > > my $count = (readdir $dh); > > Which (again, correct me if I'm wrong) basically says "Assign the scalar > value of the list whose elements are create

RE: Is empty directory?

2003-06-16 Thread Tim Johnson
I think you can also do it this way if it makes more sense (someone correct me if I'm wrong, I can't test this here): my $count = (readdir $dh); Which (again, correct me if I'm wrong) basically says "Assign the scalar value of the list whose elements are created by executing "readdir $dh" to the

checking a reg exp

2003-06-16 Thread Tim McGeary
Greetings, I am a new subscriber and I do know a little perl, but I am trying to pick up a lot more very quickly. I am having an issue with a conditional checking a regular expression that doesn't make sense and every book or online resource I have found shows the same syntax I have. Script bac

Re: Is empty directory?

2003-06-16 Thread Jair Santos
Thanks John, it is clear enough. regards Jair - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 10:59 AM Subject: Re: Is empty directory? > Jair Santos wrote: > > > > Thank to Mark , Rob and Charles for your help. > > >

RE: system function

2003-06-16 Thread Dan Muey
> I tried a couple of those ideas. > > I put a BEGIN statement in the script I'm trying to open and > to my surprise > it's opened. I'm still getting Error: No such file or directory > > The script is very small and on a unix platform: > > #!/usr/bin/perl > use CGI; > my$q = CGI::new(); I t

Re: while (<>)

2003-06-16 Thread John W. Krahn
Bryan Harris wrote: > > >> Is there a way to discover the filename of the current file being read when > >> using the angle brackets (e.g. while (<>) {} )? > > > > Well, as you may know, the <> operator reads from the file names stored > > in the @ARGV array. The current file name is stored in th

Re: concatonate to file?

2003-06-16 Thread John W. Krahn
William M West wrote: > > i'd like to take a couple of strings to concatonate to a path... > > here's my start the code::: > > #!/usr/bin/perl -w > > use strict; > use diagnostics; > > my $date = `date`; #not sure about redirecting output to $path! > > $date=~s/( ){3}/; #i think this is prope

Re: Is empty directory?

2003-06-16 Thread John W. Krahn
Jair Santos wrote: > > Thank to Mark , Rob and Charles for your help. > > I am using the following snippet of code to check if the directory is empty > and it is working. But I still cannot understand the line my $count = () = > readdir $dh; > > Can anybody explain whats the use of the = ( )

Re: system function

2003-06-16 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > I'm trying to execute a perl script with > system("sendscript.pl"); > > I also tried exec("sendscript.pl"); > > Both of these return Error: No such file or directory > > The sendscript.pl is in the same directory as the script. > What am I doing wrong? If the progr

Re: Is empty directory?

2003-06-16 Thread Jair Santos
Thank to Mark , Rob and Charles for your help. I am using the following snippet of code to check if the directory is empty and it is working. But I still cannot understand the line my $count = () = readdir $dh; Can anybody explain whats the use of the = ( ) = ? Thanks Jair sub IsEmptyDi

Re: while (<>)

2003-06-16 Thread Rob Dixon
Bryan Harris wrote: > > > Is there a way to discover the filename of the current file being read when > > > using the angle brackets (e.g. while (<>) {} )? > > > > Well, as you may know, the <> operator reads from the file names stored > > in the @ARGV array. The current file name is stored in the

Re: system function

2003-06-16 Thread Motherofperls
I tried a couple of those ideas. I put a BEGIN statement in the script I'm trying to open and to my surprise it's opened. I'm still getting Error: No such file or directory The script is very small and on a unix platform: #!/usr/bin/perl use CGI; my$q = CGI::new(); print $q->header(); print "

RE: system function

2003-06-16 Thread Dan Muey
> I'm trying to execute a perl script with system("sendscript.pl"); > > I also tried exec("sendscript.pl"); > > Both of these return Error: No such file or directory Put a ./ infront if it's unix. 1)Is it executable? -> ls -l ./sendscript.pl If not try: exec("perl ./sedscript

RE: system function

2003-06-16 Thread Johnson, Shaunn
--hrm. --would use Cwd; --work for you? i know that i had --silly problems like this and decided --it try that just to make sure i was --where i *thought* i was directory wise ... -X -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 1

RE: system function

2003-06-16 Thread Miller, Joseph S
What happens when you include the path? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 11:27 AM To: [EMAIL PROTECTED] Subject: system function I'm trying to execute a perl script with system("sendscript.pl"); I also tried exec("sendscri

RE: system function

2003-06-16 Thread Paul Kraus
Try... system("perl sendscript.pl"); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 12:27 PM To: [EMAIL PROTECTED] Subject: system function I'm trying to execute a perl script with system("sendscript.pl"); I also tried exec("sendscrip

system function

2003-06-16 Thread Motherofperls
I'm trying to execute a perl script with system("sendscript.pl"); I also tried exec("sendscript.pl"); Both of these return Error: No such file or directory The sendscript.pl is in the same directory as the script. What am I doing wrong?

Re: concatonate to file?

2003-06-16 Thread Robin Norwood
"West, William M" <[EMAIL PROTECTED]> writes: > i'd like to take a couple of strings to concatonate to a path... > > here's my start the code::: > > #!/usr/bin/perl -w > > > use strict; > use diagnostics; > > my $date = `date`; #not sure about redirecting output to $path! > > $date=~s/( ){3}

Re: while (<>)

2003-06-16 Thread Bryan Harris
>> Is there a way to discover the filename of the current file being read when >> using the angle brackets (e.g. while (<>) {} )? > > Well, as you may know, the <> operator reads from the file names stored > in the @ARGV array. The current file name is stored in the $ARGV > variable and the cur

Re: RE: sudo within script

2003-06-16 Thread
I think I was unclear. I did a search on cpan for sudo and came up with psh only. I know the method I will use to login via ssh. Is there an ssh module for sudo? - Original Message - From: Paul Kraus Sent: 6/16/2003 8:46:15 AM To: [EMAIL PROTECTED];[EMAIL PROTECTED] Subject: RE: sudo w

RE: concatonate to file?

2003-06-16 Thread Tim Johnson
In Perl there is a concatenation operator for this kind of thing, the dot (.) Once you've formatted your date, you should be able to do something like this: my $newfile = $file.$date; rename $file,$newfile; I think that's what you're asking... -Original Message- From: West, William M [

RE: Maybe OFF Topic - FTP Directory Size

2003-06-16 Thread Tim Johnson
You can do this with Net::FTP, but you'll have to write your own recursive subroutine to get the subfolders... -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 8:09 AM To: [EMAIL PROTECTED] Subject: Maybe OFF Topic - FTP Directory Size Is their

concatonate to file?

2003-06-16 Thread West, William M
i'd like to take a couple of strings to concatonate to a path... here's my start the code::: #!/usr/bin/perl -w use strict; use diagnostics; my $date = `date`; #not sure about redirecting output to $path! $date=~s/( ){3}/; #i think this is proper to just take the string

Maybe OFF Topic - FTP Directory Size

2003-06-16 Thread Paul Kraus
Is their any Linux tools I can use to attach to an ftp site. Go to a folder and then get the file size of everything in or beneath the selected folder? If I can do this perl even better. If not any point in the right direction would useful. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: updating dos access time

2003-06-16 Thread Mark G
> Hi, HerrO > does not seem to update the last accessed time of c:\test thats because by doing " > open(FILE,">c:\\test\\file.txt"); " you are creating a new file. You should change that to "> open(FILE,">> c:\\test\\file.txt");". run this; <~~~cut #!PERL -w open(FILE,'>> ./test.dat') || die

RE: sudo within script

2003-06-16 Thread Paul Kraus
Do a search on cpan for SSH. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 10:26 AM To: [EMAIL PROTECTED] Subject: sudo within script I am writing a script that will login to multiple remote hosts and run commands as root. I would like

sudo within script

2003-06-16 Thread
I am writing a script that will login to multiple remote hosts and run commands as root. I would like the script to prompt for the password, not echo it in plain text and then be able to pass it to the remote hosts. Is there a safe way to do this? Thanks for any advice -- To unsubscribe, e-m

Re: I need to make this not end

2003-06-16 Thread Rob Anderson
Hi err, Mr T. Here's a solution to your question, but from a different point of view... -- #!perl -w use strict; my $im_thinking_of = int(rand 10); my $guess; do { print "Pick a number:"; $guess = ; chomp $guess; if ($guess > $im_thinking_of)

Re: difference between use Carp and use Carp qw(cluck)

2003-06-16 Thread Jenda Krynicky
From: Ramprasad <[EMAIL PROTECTED]> > What is the diff between > > use Carp qw(cluck); > Carp::cluck("hello"); > > and > > use Carp; > Carp::Cluck("hello"); The difference is that in the first case the cluck() is imported into the current package/namespace so you may write just cl

difference between use Carp and use Carp qw(cluck)

2003-06-16 Thread Ramprasad
Hi all, What is the diff between use Carp qw(cluck); Carp::cluck("hello"); and use Carp; Carp::Cluck("hello"); I had assumed that when I 'use Carp qw ( cluck )' I will be able to use only the cluck function of Carp but when I tried it out I found it was not so. Then where does the differenc

Installing Log::Agent, nmake test errors

2003-06-16 Thread Clinton
Hi list Using Winnt, ActivePerl 5.6.0.623. I was unable to install Log-Agent via ppm from Activestate. (There is no reference to MSWin32-x86-multi-thread, in fact a number of ppd files in http://ppm.activestate.com/PPMPackages/5.6plus/ dont have this). So I tried using CPAN. When I run nmake tes