Re: removing characters

2006-09-14 Thread John W. Krahn
ubergoonz wrote: > Hi, Hello, > I have a certain variables of emplyee number which comes in the format of > [a000] or [u000] {whereby 000 is some serial numbers}. > > I would like to remove the enclosed [ & ] see if it is belong to class > a or > u , i can do it as follow > > $var

Re: removing characters

2006-09-14 Thread jeffhua
Hi, You can do it like: $var =~ s/\[|\]//g; or $var =~ s/[\[\]]//g; -Original Message- From: [EMAIL PROTECTED] To: beginners@perl.org Sent: Fri, 15 Sep 2006 1:54 PM Subject: removing characters Hi, I have a certain variables of emplyee number which comes in the format of [a

removing characters

2006-09-14 Thread ubergoonz
Hi, I have a certain variables of emplyee number which comes in the format of [a000] or [u000] {whereby 000 is some serial numbers}. I would like to remove the enclosed [ & ] see if it is belong to class a or u , i can do it as follow $var = /\[//; $var = /\]//; if ($var =~ '^a) {

extracting several text from logs using regex

2006-09-14 Thread Michael Alipio
Hi, A log file contains several of these lines: session.blablahbla blablabla proto:6 blablabla srcip:90.0.0.1 blablabla blablabla srcport:3243 blablabla dstport:23 blablabla session.blablahbla blablabla proto:6 blablabla srcip:90.0.0.1 blablabla blablabla srcport:3243 blablabla dstport:2

Re: bizarre fractional exponents math

2006-09-14 Thread Mumia W.
On 09/14/2006 06:47 PM, Bryan R Harris wrote: Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 % perl -e 'print (-12.17)**(0.2), "\n"' -12.17% perl -e 'print ((-12.17)**(0.2)), "\n"' nan% Yes, the "\n" isn't getting printed for some reason on the 2nd tw

Re: bizarre fractional exponents math

2006-09-14 Thread Rob Dixon
Bryan R Harris wrote: Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 This means print(-(12.17 ** 0.2), "\n") because exponentiation has a higher priority than unary minus. (See the table of priorities in perldoc perlop). % perl -e 'print (-12.17)

Re: bizarre fractional exponents math

2006-09-14 Thread John W. Krahn
Bryan R Harris wrote: > > Can someone explain this behavior? perldoc perlfunc [snip] Any function in the list below may be used either with or without parentheses around its arguments. (The syntax descriptions omit the parentheses.) If you use the parentheses, the simple (b

bizarre fractional exponents math

2006-09-14 Thread Bryan R Harris
Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 % perl -e 'print (-12.17)**(0.2), "\n"' -12.17% perl -e 'print ((-12.17)**(0.2)), "\n"' nan% Yes, the "\n" isn't getting printed for some reason on the 2nd two examples. Bottom line: -12.17**0.2 ==> -1.6

any traction on JPL?

2006-09-14 Thread Alan Campbell
hello folks, anything I can find on this mail list & googling shows only JPL references > 3 years old. Is there any active work on making Java-Perl work together? I ask because my company is moving from a COM based IDE to an Eclipse based one. There are a large set of users with exist

Re: Need help with variable value/usage

2006-09-14 Thread Mike Blezien
Dani, - Original Message - From: "D. Bolliger" <[EMAIL PROTECTED]> To: Sent: Thursday, September 14, 2006 2:36 PM Subject: Re: Need help with variable value/usage Mike Blezien am Donnerstag, 14. September 2006 21:10: Hello, I'm working on making some modifications to a calendar sc

Re: Need help with variable value/usage

2006-09-14 Thread John W. Krahn
Mike Blezien wrote: > Hello, Hello, > I'm working on making some modifications to a calendar script and > haven't quiet figured out what the purpose of value of an assigned > varilable $Template as it's used in various different places and > assigned different value of some sort. What exactly is

Re: Need help with variable value/usage

2006-09-14 Thread D. Bolliger
Mike Blezien am Donnerstag, 14. September 2006 21:10: > Hello, > > I'm working on making some modifications to a calendar script and haven't > quiet figured out what the purpose of value of an assigned varilable > $Template as it's used in various different places and assigned different > value of

Re: german characters in Perl

2006-09-14 Thread Tom Phoenix
On 9/14/06, Xavier Mas i Ramón <[EMAIL PROTECTED]> wrote: I need in my job to handle a german file under Windows XP operating system although always use Linux at home). So, I've to install "Lingua-DE-ASCII-0.11.tar.gz" (it works well under my Linux system), but I can't find it for Windows. Is th

Need help with variable value/usage

2006-09-14 Thread Mike Blezien
Hello, I'm working on making some modifications to a calendar script and haven't quiet figured out what the purpose of value of an assigned varilable $Template as it's used in various different places and assigned different value of some sort. What exactly is the purpose of the usage of the $T

german characters in Perl

2006-09-14 Thread Xavier Mas i Ramón
Hello again, folks I need in my job to handle a german file under Windows XP operating system although always use Linux at home). So, I've to install "Lingua-DE-ASCII-0.11.tar.gz" (it works well under my Linux system), but I can't find it for Windows. Is there other module or way to get around

Re: hash access

2006-09-14 Thread Xavier Mas i Ramón
A Dijous 14 Setembre 2006 11:38, Mumia W. va escriure: > On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: > > Hi all!, > > > > I'm trying to create a sorted (ASCII) hash file but get all time a syntax > > error in line "my $abreviatures{$clau} = 1;" at "$abreviatures{ <--". > > Sure is an stupid

Re: hash access

2006-09-14 Thread Xavier Mas i Ramón
A Dijous 14 Setembre 2006 08:31, John W. Krahn va escriure: > Xavier Mas i Ramón wrote: > > Hi all!, > > Hello, > > > I'm trying to create a sorted (ASCII) hash file but get all time a syntax > > error in line "my $abreviatures{$clau} = 1;" at "$abreviatures{ <--". > > Sure is an stupid mistake bu

Re: Archive::Zip and hash issues

2006-09-14 Thread Mumia W.
On 09/14/2006 09:20 AM, Derek B. Smith wrote: [...] sub zipit { ##-- Add all readable files below $oldir --## ##-- and write them into a file. --## my $zip = Archive::Zip->new(); my $entry = $zip->addDirectory ("$oldir/$word/") or die "Failed to add file for archive zip $!"; $entry->de

Re: hash access

2006-09-14 Thread Mumia W.
On 09/14/2006 07:17 AM, John W. Krahn wrote: Mumia W. wrote: The "my" command doesn't work that way. You have to "my" the entire hash like so: ... my $abreviatures; That is not a hash, that is a scalar. ITYM: my %abreviatures; John Oops, thanks :-) -- To unsubscribe, e-mail: [EMAIL

Re: Archive::Zip and hash issues

2006-09-14 Thread Derek B. Smith
--- Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 9/14/06, Derek B. Smith > <[EMAIL PROTECTED]> wrote: > > > my %subdir_for = ( > > 'bpjava\-msvc' => 23, > > 'bpjava\-susvc' => 24, > > 'bpjava\-usvc'=> 25, > > ) > > Those backslashes aren't doing anything. But they > aren't needed, > e

Re: Archive::Zip and hash issues

2006-09-14 Thread Tom Phoenix
On 9/14/06, Derek B. Smith <[EMAIL PROTECTED]> wrote: my %subdir_for = ( 'bpjava\-msvc' => 23, 'bpjava\-susvc' => 24, 'bpjava\-usvc'=> 25, ) Those backslashes aren't doing anything. But they aren't needed, either; hyphen isn't a special character in a hash key or single-quoted stri

Archive::Zip and hash issues

2006-09-14 Thread Derek B. Smith
I need some help in this again. Firt I built a hash consisting of 52 unique subdir names, but 3 of these sub-dirs have a dash like so bpjava-msvc. During the translation is the coorect way to ignore the by using the \? my %subdir_for = ( 'bpjava\-msvc' => 23, 'bpjava\-susvc' => 24, 'bpja

Re: sprintf and printf in Perl

2006-09-14 Thread jeffhua
Hello, The simple difference is,'sprintf' format the strings and pass the result to a variable. $ perl -e 'my $var=sprintf "%30s\n","hello,world";print $var' hello,world While 'printf' print the result directly to screen. $ perl -e 'printf "%30s\n","hello,world"'

sprintf and printf in Perl

2006-09-14 Thread chen li
Hi all, First of all I want to thank you all for reading and replying my previous posts. Now I come across to another problem: I want to print out a AoA. If I use printf I get what I expect. If I use sprintf for string I get error messages but the remaining still look OK. But If use sprintf also

Re: extracting line between words

2006-09-14 Thread John W. Krahn
John W. Krahn wrote: > [EMAIL PROTECTED] wrote: >> >>But the output is coming like this TheSunrisesintheeast >> >>But I want the output like this The Sun rises in the east > > my @line = "The Sun rises in > the east and "; > print join ' ', split ' ', $line[ 0 ]; print map { join(

Re: hash access

2006-09-14 Thread John W. Krahn
Mumia W. wrote: > On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: >> >> I'm trying to create a sorted (ASCII) hash file but get all time a >> syntax error in line "my $abreviatures{$clau} = 1;" at >> "$abreviatures{ <--". Sure is an stupid mistake but I'm not able to >> see it even checking with

Re: extracting line between words

2006-09-14 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi Perlers... Hello, > I need to extract line between two words > > like > > > @line = "The Sun rises in > the east and "; > > Now I want to extract the line from The word to east > > For tht I am using the following code: > > #!

Re: hash access

2006-09-14 Thread Mumia W.
On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: Hi all!, I'm trying to create a sorted (ASCII) hash file but get all time a syntax error in line "my $abreviatures{$clau} = 1;" at "$abreviatures{ <--". Sure is an stupid mistake but I'm not able to see it even checking with my "Learning Perl

RE: extracting line between words

2006-09-14 Thread Nagasamudram, Prasanna Kumar
Hi Mayank Please add $\=" "; to your code as follows. $\ is the output field separator. #!/usr/bin/perl use warnings; use strict; my @line = "The Sun rises in the east and "; my $store; $\=" "; ## <- OUTPUT FIELD SEPERATOR## while(<@line>){ print if $_ =~ /The/ ..

Re: extracting line between words

2006-09-14 Thread Igor Sutton
while(<@line>){ print if $_ =~ /The/ .. /east/ ; I suggest this: print join " ", (grep { /The/ .. /east/ } <@line>); -- Igor Sutton Lopes t: +55 51 9627.0779 e: [EMAIL PROTECTED]

extracting line between words

2006-09-14 Thread mayank . ahuja
Hi Perlers... I need to extract line between two words like @line = "The Sun rises in the east and "; Now I want to extract the line from The word to east For tht I am using the following code: #!/usr/bin/perl use warnings; use strict; my @line = "The Sun r

RE: need info on where can i download the Net-SSH-Perl.ppd

2006-09-14 Thread Lee Goddard
> i need to install the the package NET::SSH::Perl > and when i > try to do that through PPM i get the package not found error. There is no PPD on the ActiveState servers, but you can find one here: http://cpan.uwinnipeg.ca/module/Net::SSH::Perl The link includes docs on how to perform the ins

need info on where can i download the Net-SSH-Perl.ppd

2006-09-14 Thread Vishwanath Chitnis
hi all, i need to install the the package NET::SSH::Perl and when i try to do that through PPM i get the package not found error. so i am trying to install the Net-SSH-Perl.ppd and then install the package. any idea i can get this PPD file.i tried to search on net but could not get it there. or l