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"
How can I install GD librariies on U10 solaris 7 machine to run the graph
module.
Need help really bad.
Regards,
Ebaad.
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
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
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
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
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 . "
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
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
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
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
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
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
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
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
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
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
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
#--
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 -
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
>
> 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();
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
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)
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
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 .
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
>
>
> >
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
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
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
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
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
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
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
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
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
> -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
I have the following as my data inside a package:
my $dataBlock = { isInsertable=> $isInsertable,
fields => undef,
requiredFields => undef,
selectionFields =
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
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
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
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
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
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
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
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
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
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]
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
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
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
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
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]
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:/
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
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
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-
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
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
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]
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");
>
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
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
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]
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
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
65 matches
Mail list logo