Re: Book on Perl!

2002-09-06 Thread Ebaad Ahmed
learning perl by Oeilly is so far great and unquestionably a good book for starting to learning perl, but if you need to bigen with the installation instructions you can get them on perl.com or perl.org or perldoc.com websites. Regards, Ebaad. - Original Message - From: "Nitin Yogishwar"

GD library

2002-09-06 Thread Ebaad Ahmed
How can I install GD librariies on U10 solaris 7 machine to run the graph module. Need help really bad. Regards, Ebaad.

Book on Perl!

2002-09-06 Thread Nitin Yogishwar
Hi, Can some one tell me which is best book on Perl language for beginners. - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes

Re: print only what a regex actually hits

2002-09-06 Thread George Schlossnagle
Oops - teaches me not to test my solution :). Both suffer from not adding a newline to the last element of the join. You could stick a newline at the end, but doing so naively will generate a number of empty lines. The simplest thing is probably: while(<>) { print join("", map { "$_ l

Re: print only what a regex actually hits

2002-09-06 Thread Harry Putnam
George Schlossnagle <[EMAIL PROTECTED]> writes: > while(<>) { > print join("\n", map { "$_ lineno $." } /(string)/g); > } George, I haven't gotten good results with either of the pieces of code you posted. This one gives me. string lineno 1 string lineno 1string lineno 2 I can fix

Re: print only what a regex actually hits

2002-09-06 Thread George Schlossnagle
while(<>) { print join("\n", map { "$_ lineno $." } /(string)/g); } On Friday, September 6, 2002, at 10:32 PM, Harry Putnam wrote: > Tinkering with some of the suggestions here, I was looking for a way > to get the line number in there. Thought maybe I could just > con

Re: print only what a regex actually hits

2002-09-06 Thread Harry Putnam
Tinkering with some of the suggestions here, I was looking for a way to get the line number in there. Thought maybe I could just concatenate it in there: With this test file: string strung strang string other junk blabbitty string other junk while(<>){ push @array,$_ =~ /(string)/g . "

perlcc boot_File__Glob error (solution)

2002-09-06 Thread Tony
I couldn't find a better place to post this information than beginners section so here it is: -- If you are compiling your perl prog with perlcc and receive this error, /tmp/ccaooDv1.o: In function `dl_init': /tmp/c

Re: print only what a regex actually hits

2002-09-06 Thread Harry Putnam
Timothy Johnson <[EMAIL PROTECTED]> writes: > You mean something like this? > > while(){ > push @matches,$_ =~ /(silly)/; > } > > foreach(@matches){ > print $_."\n"; > } Bingo... but this looks like it might be a sort of default callback or remembered item inside parens. Is it? Anyway

Re: print only what a regex actually hits

2002-09-06 Thread Harry Putnam
david <[EMAIL PROTECTED]> writes: > you are probably looking for the $& variable: > > open(FILE,'file') || die $!; > while(){ > print $&,"\n" if(/silly/); > } > close(FILE); > cool, a whole different way to do it thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: print only what a regex actually hits

2002-09-06 Thread George Schlossnagle
or while() { /(myregex)/ && print "$1\n"; } or if you are concerned about multiple matches in a line while() { print join("\n", /(myregex)/g); } if there are worries about Timothy Johnson wrote: >You mean something like this? > >while(){ > push @matches,$_ =~ /(silly)/; >} > >foreac

Re: print only what a regex actually hits

2002-09-06 Thread david
you are probably looking for the $& variable: open(FILE,'file') || die $!; while(){ print $&,"\n" if(/silly/); } close(FILE); __END__ you probably want to check out $`(pre match) and $'(post match) as well. note the $&, $` and $' are kind of expensive and you usually can do the above w

RE: print only what a regex actually hits

2002-09-06 Thread Timothy Johnson
You mean something like this? while(){ push @matches,$_ =~ /(silly)/; } foreach(@matches){ print $_."\n"; } -Original Message- From: Harry Putnam [mailto:[EMAIL PROTECTED]] Sent: Friday, September 06, 2002 4:18 PM To: [EMAIL PROTECTED] Subject: print only what a regex actuall

print only what a regex actually hits

2002-09-06 Thread Harry Putnam
Hope this isn't too often repeated question with glaringly obvious answer: How to print only what a regex hits from a file, not the whole line. IMPORTANT: I don't want techniques involving call back (remembered) operators and parens, I know how to piece those together for simple things like the f

Re: hours minutes and seconds in seconds

2002-09-06 Thread John W. Krahn
Rob wrote: > > I'm working on a script that parses a log file which gives connection time > in seconds. Below is how I resolved the problem but I think there must be > a better way? > > #!/usr/bin/perl -w > > use strict; > > my $sessionTime = 4000; > > my $hour = $sessionTime / 3600; > my $h

Re: Quit with keystroke?

2002-09-06 Thread david
Fogle Cpl Shawn B wrote: > I'm writing my first perl script with the llama (the beginner o'riley > book) but the one thing I need to make a complete program that I don't see > in the book or the perl faqs (although I'd bet it's there somewhere) is a > acceptable way to cause the script to termina

Re: stumped on error...

2002-09-06 Thread drieux
On Friday, Sep 6, 2002, at 08:58 US/Pacific, Mike Singleton wrote: > Sorry for showing my ignorance, but what is and how would I use 'see > inline'... thanks! phase 0: perldoc Inline::Files phase 1: http://search.cpan.org/search?mode=all&query=Inline ciao drieux --- -- To unsub

Re: stuck on finding variables

2002-09-06 Thread david
Sudarshan Raghavan wrote: > On 5 Sep 2002, Chuck Belcher wrote: > > @scalars_used{/(\$\w+)/g} = (); > print Dumper(\%scalars_used); > } > print Dumper(\%scalars_used); this is not going to work well. consider: #!/usr/bin/perl -w use strict; =item whatever $w $x $y $z =cut #--

help with MIME::Lite and Net::SMTP

2002-09-06 Thread Ernesto Freyre
Dear Sirs: Please , I would want an idea about how to prepare a message with MIME::Lite but sending it with Net::SMTP, I want this since MIME::Lite doesn´t have control forn bad addresses and I need to perform it with Net::SMTP Thank you in advance. Ernesto Freyre Área de Operaciones Qnet -

RE: hours minutes and seconds in seconds

2002-09-06 Thread Nikola Janceski
http://search.cpan.org/author/MSERGEANT/Time-Object-1.00/Seconds.pm that can do it too. > -Original Message- > From: Rob [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 06, 2002 1:19 PM > To: [EMAIL PROTECTED] > Subject: hours minutes and seconds in seconds > > > I'm working on a

Re: my, hashref, and 2 arrays

2002-09-06 Thread david
> > if (wantarray) { > return @vals; > } > else { > # create hash where keys are from @heads and values are from @vals > # then return a reference to that hash, only when not in list context > my %vals; > @vals{@heads} = @vals; > return \%vals; > } > try: my $p = af();

hours minutes and seconds in seconds

2002-09-06 Thread Rob
I'm working on a script that parses a log file which gives connection time in seconds. Below is how I resolved the problem but I think there must be a better way? #!/usr/bin/perl -w use strict; my $sessionTime = 4000; my $hour = $sessionTime / 3600; my $hr = int($hour); $sessionTime = $sessio

Re: Quit with keystroke?

2002-09-06 Thread zentara
On Fri, 6 Sep 2002 06:15:22 +0300 , [EMAIL PROTECTED] (Fogle Cpl Shawn B) wrote: >I'm writing my first perl script with the llama (the beginner o'riley book) >but the one thing I need to make a complete program that I don't see in the >book or the perl faqs (although I'd bet it's there somewhere)

Re: Changing unix user account using perl?

2002-09-06 Thread drieux
On Friday, Sep 6, 2002, at 03:38 US/Pacific, Sam Graves wrote: > Is it possible to `su - user` and send the password via perl? yes. you might want to look at say perldoc perlipc to understand how to 'dialog' with "complex" child process ciao drieux --- -- To unsubscribe, e-m

Re: DB_File to read Berkeley db

2002-09-06 Thread drieux
On Thursday, Sep 5, 2002, at 22:44 US/Pacific, Ramprasad A Padmanabhan wrote: [..] > Thanx a lot sir, > Now I atleast know where to get started. Infact I had done man > dbopen and wrote a small code just to open a db file But I was not > using -ldb when did gcc so it would never compile .

Re: stumped on error...

2002-09-06 Thread Mike Singleton
Sorry for showing my ignorance, but what is and how would I use 'see inline'... thanks! "Nikola Janceski" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > instead of accessing the $opt_h from the namespace of Getopt that way do > this: > see inline > > > >

Re: How to read a char from STDIN without CR

2002-09-06 Thread Draco Paladin
Mohd Salman <[EMAIL PROTECTED]> wrote: > Hi, > How I can read a char from STDIN without the need to press CR or EOF. > Thanks > M.Salman perldoc -q 'single character' Found in /opt/perl/lib/5.6.1/pod/perlfaq5.pod How can I read a single character from a file? From the keyboard

Re: stumped on error...

2002-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, Mike Singleton said: >Name "Getopt::Std::opt_h" used only once: possible typo. What makes you think that's an error? It's a WARNING, and won't affect the way your program runs. As the perldiag docs tell you, that warning means that Perl saw you use that variable name only once, which

RE: stumped on error...

2002-09-06 Thread Nikola Janceski
instead of accessing the $opt_h from the namespace of Getopt that way do this: see inline > -Original Message- > From: Mike Singleton [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 06, 2002 11:17 AM > To: [EMAIL PROTECTED] > Subject: stumped on error... > > > Name "Getopt::Std::o

RE: like an exe file

2002-09-06 Thread Timothy Johnson
If you're checking out Perl2exe, be sure to check out PerlApp as well. It comes as part of the ActiveState Perl Dev Kit. As for perlcc, it's really still a work in progress, so I wouldn't try to use it for any production code. -Original Message- From: Dharmendra Rai [mailto:[EMAIL PROT

stumped on error...

2002-09-06 Thread Mike Singleton
Name "Getopt::Std::opt_h" used only once: possible typo. === Partial Script == use strict; use English; use Getopt::Std; use Cwd; my $RPTFILE="jobrpt.tmp"; getopts('hn:p:o:s:') or die ; ($Getopt::Std::opt_h) and die; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

RE: get a list into array from a remote machine

2002-09-06 Thread Priss
Thank you Jeff, it does work :)) But for some reason, it tells me permission denied when it tries to read the remote file even though I can view it by ssh onto it manually... Priss --- Jeff AA <[EMAIL PROTECTED]> wrote: > > Try > > @lines = `/usr/local/bin/ssh -l priss remotehost > cat list

Re: Arrays inside

2002-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, Tobin, Elliot said: >sub setFields > { >my ($inBlock, @fieldList) = @_; > >foreach my $i (@fieldList) >{ > push($inBlock->{'fields'}, $i); You'd need to say push @{ $inBlock->{fields} }, $i; >} > >return $inBlock; > } But given your current function, it's

Re: Arrays inside

2002-09-06 Thread James Edward Gray II
On Friday, September 6, 2002, at 08:54 AM, Tobin, Elliot wrote: > I have the following as my data inside a package: > > my $dataBlock = { isInsertable=> $isInsertable, > fields => undef, fields

RE: Arrays inside

2002-09-06 Thread Nikola Janceski
see inline comments: > -Original Message- > From: Tobin, Elliot [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 06, 2002 9:55 AM > To: '[EMAIL PROTECTED]' > Subject: Arrays inside > > > I have the following as my data inside a package: > > my $dataBlock = { isInsertable

RE: Arrays inside

2002-09-06 Thread Bob Showalter
> -Original Message- > From: Tobin, Elliot [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 06, 2002 9:55 AM > To: '[EMAIL PROTECTED]' > Subject: Arrays inside > > > I have the following as my data inside a package: > > my $dataBlock = { isInsertable=> $isInsertab

Arrays inside

2002-09-06 Thread Tobin, Elliot
I have the following as my data inside a package: my $dataBlock = { isInsertable=> $isInsertable, fields => undef, requiredFields => undef, selectionFields =

RE: get a list into array from a remote machine

2002-09-06 Thread Jeff AA
Try @lines = `/usr/local/bin/ssh -l priss remotehost cat list-txt`; and then skip any blank lines at this end... foreach my $line ( @lines ) { chomp $line; next unless $line; } regards Jeff > -Original Message- > From: Priss [mailto:[EMAIL PROTECTED]] > Sent: 06 September 200

Re: regex help pt.II

2002-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, Mike Singleton said: >1. replace all spaces with commas $str =~ s/\s/,/g; or $str =~ tr/\n\r\t\f /,/; >2. strip all information before the date You probably want something like ($keep) = $str =~ /(\w{3} \w{3} .*)/; This assumes the date is going to be the first occurrence o

How to read a char from STDIN without CR

2002-09-06 Thread Mohd Salman
Hi, How I can read a char from STDIN without the need to press CR or EOF. Thanks M.Salman _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

Re: Initializing...

2002-09-06 Thread Janek Schleicher
Elliot Tobin wrote at Thu, 05 Sep 2002 20:35:48 +0200: > If my constructor takes four arguments, ala: > > my ($instanceName, $instanceHost, $instanceUser, $instancePass) = @_; > > What's an eloquent way of looping through those four and setting their > value to "" if there are no arguments pas

regex help pt.II

2002-09-06 Thread Mike Singleton
To keep this simple. On the text string I would like to: 1. replace all spaces with commas 2. strip all information before the date === Text string 172.16.54.132 ssjobhnd Sun Jun 16 10:40:10 2002 SNBJH_3710J Task 1: KB transferred 8124972.2 Task time 830 s. Throughput 9789.1 KB/s === End

Re: Strange error

2002-09-06 Thread Dharmendra Rai
Then there is no problem :) Thanx __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: Strange error

2002-09-06 Thread John W. Krahn
Dharmendra rai wrote: > > go to www.perldoc.com/perl5.8.0/pod/perl.html and read "perlre" Why, when /usr/lib/perl5/5.6.0/pod/perlre.pod and /usr/share/man/man1/perlre.1 are on my hard drive? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: Quit with keystroke?

2002-09-06 Thread Sudarshan Raghavan
On Fri, 6 Sep 2002, Fogle Cpl Shawn B wrote: > I'm writing my first perl script with the llama (the beginner o'riley book) > but the one thing I need to make a complete program that I don't see in the > book or the perl faqs (although I'd bet it's there somewhere) is a > acceptable way to cause t

Re: Strange error

2002-09-06 Thread Dharmendra Rai
well perlregxp( perl regular experssion which i wrote clearly) stands for 'perlre. __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAI

Re: Strange error

2002-09-06 Thread Dharmendra Rai
sorry __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: like an exe file

2002-09-06 Thread Dharmendra Rai
Hi, Perl2Exe is a command line utility for converting perl scripts to executable files.This allows you to create stand alone programs in perl that do not require the perl interpreter. You can also ship the executable file without having to ship your perl source code. Perl2Exe can generate executa

Re: like an exe file

2002-09-06 Thread Dharmendra Rai
on unix u can use perlcc. __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Quit with keystroke?

2002-09-06 Thread Fogle Cpl Shawn B
I'm writing my first perl script with the llama (the beginner o'riley book) but the one thing I need to make a complete program that I don't see in the book or the perl faqs (although I'd bet it's there somewhere) is a acceptable way to cause the script to terminate. I have been having to goto ano

RE: like an exe file

2002-09-06 Thread Javeed SAR
yes i got it, you can use perl2exe/ Thanks. Regards Javeed -Original Message- From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 07, 2002 7:35 PM To: Perl beginners Subject: RE: like an exe file On Fri, 6 Sep 2002, Javeed SAR wrote: > > what is this perl2

Changing unix user account using perl?

2002-09-06 Thread Sam Graves
Is it possible to `su - user` and send the password via perl? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: like an exe file

2002-09-06 Thread Sudarshan Raghavan
On Fri, 6 Sep 2002, Javeed SAR wrote: > > what is this perl2exe function? > Can i use this? You will have to download and install it. I have never used it, so don't know anything about it. I googled this http://www.google.com/search?hl=en&ie=ISO-8859-1&q=perl2exe+unix and I got this http:/

RE: like an exe file

2002-09-06 Thread Javeed SAR
what is this perl2exe function? Can i use this? Regards Javeed -Original Message- From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 07, 2002 7:12 PM To: Perl beginners Subject: Re: like an exe file On Fri, 6 Sep 2002, Javeed SAR wrote: > Hi all, > > I

Re: Strange error

2002-09-06 Thread Dharmendra Rai
go to www.perldoc.com/perl5.8.0/pod/perl.html and read "perlre" __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Re: get a list into array from a remote machine

2002-09-06 Thread Dharmendra Rai
try the execution of that block in eval (). __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: like an exe file

2002-09-06 Thread Sudarshan Raghavan
On Fri, 6 Sep 2002, Javeed SAR wrote: > Hi all, > > I have perl scripts , i don't want anybody to open it or see? > It should be like an exe file > > Is it posible? perldoc -q 'How can I hide the source for my Perl program?' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

like an exe file

2002-09-06 Thread Javeed SAR
Hi all, I have perl scripts , i don't want anybody to open it or see? It should be like an exe file Is it posible? Regards Javeed

Re: Strange error

2002-09-06 Thread John W. Krahn
Dharmendra rai wrote: > > man perlregxp $ man perlregxp No manual entry for perlregxp John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: get a list into array from a remote machine

2002-09-06 Thread Sudarshan Raghavan
On Fri, 6 Sep 2002, Priss wrote: > Hiya, > > Wonder if someone can correct me, I am trying to get a > list into an array from a file on a remote machine. > For some reason, it didn't work: > > @array = `/usr/local/bin/ssh -l priss remotehost > "open(FILE,"/home/priss/list-txt"); >

Re: Strange error

2002-09-06 Thread Sudarshan Raghavan
On Fri, 6 Sep 2002, Dharmendra Rai wrote: > man perlregxp Have you tried this out? I had mentioned to you a few days earlier to not remove relevant parts of the post when replying. You continue in this fashion, people in this list will not know what you are replying too and this can only le

get a list into array from a remote machine

2002-09-06 Thread Priss
Hiya, Wonder if someone can correct me, I am trying to get a list into an array from a file on a remote machine. For some reason, it didn't work: @array = `/usr/local/bin/ssh -l priss remotehost "open(FILE,"/home/priss/list-txt"); @arr1 = ; close(FILE); f

Re: Strange error

2002-09-06 Thread Dharmendra Rai
man perlregxp __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Strange error

2002-09-06 Thread John W. Krahn
Dharmendra rai wrote: > > Hi Hello, > Read Perl regular expressions. Thanks for the advice. Why do you feel that I need to read "Perl regular expressions" and what is it and where can I find it? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: stuck on finding variables

2002-09-06 Thread John W. Krahn
Chuck Belcher wrote: > > I have just started using perl and I have been asked to write a script > that will open a perl script, count all of the variables identified by > $... and print to the screen the number of unique variables and display > a list of variables used. Can anyone tell me where