modules

2004-06-18 Thread aditi gupta
hi to all, do LWP and HTTP::Request modules come alongwithh perl (activeperl 5.8) or one has to separately install them? Yahoo! India Matrimony: Find your partner online.

pls help

2004-06-18 Thread shashideep nuggehalli
Hello everybody, My name is Shashideep. I am new member of the group. I have been learning PERL for the last few days. I want to be good enough to take up interviews . I would be grateful if somebody could direct me to any site which would give me an idea of what type of questions can be expe

RE: [PBML] Help with Data Structures

2004-06-18 Thread Charles K. Clarkson
From: William Martell wrote: : Hello All, : : I was wondering if someone could tell me how to manipulate : this data structure. I have attached the datafile. My code : and code results are printed below. : : If you take a look at the results, you will see that there

Re: \b confusion

2004-06-18 Thread Randy W. Sims
After a long day, a long night, and another long day I spew crap. And no one catches me. A couple hours later I lay down to finally get some sleep and !! I realized I screwed up. I try to shove it off to no avail. I must respond... Randy W. Sims wrote: [EMAIL PROTECTED] wrote: According to the

Re: VARIABLES

2004-06-18 Thread Shlomi Fish
On Fri, 18 Jun 2004 [EMAIL PROTECTED] wrote: > All, > > Does perl have built in variable names such as in awk? Here are the ones > in awk > I know perl uses ARGV, but what about: > > ARGC # of command lines arguments For that you use scalar(@ARGV). > FILENAME name of current input file That's

Re: VARIABLES

2004-06-18 Thread Brian McGraw
Hello, If you're coming from awk or interested in porting awk scripts, take a look also at perldoc perltrap (section on awk traps) man a2p I'd also take a look at perldoc perlvar for a complete list of predefined variables. Brian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

RE: Reading the Array line

2004-06-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Greetings, > > I have an array with multiple rows. Each row is a record with several > elements. > > I wish to do two things: > > Read each line and print out some of the data. > Find multiple related lines in a second array, and print out some of > the data. >

Reading the Array line

2004-06-18 Thread RHug505456
Greetings, I have an array with multiple rows. Each row is a record with several elements. I wish to do two things: Read each line and print out some of the data. Find multiple related lines in a second array, and print out some of the data. More specifically, in the first array is header inf

Re: \b confusion

2004-06-18 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: According to the principle of \b why is this doing this? $word = "(HP)"; $word =~ s/[,\]\)\}]\b//; $word =~ s/\b[,\]\)\}]//; Since the parentheses is on either side of the boundary, it should take off bpth of them. Instead the result is:$word = "(HP" It only took of

[pkraus@pelsupply.com: Re: \b confusion]

2004-06-18 Thread Paul D. Kraus
--- Begin Message --- On Fri, Jun 18, 2004 at 12:43:31PM -0400, [EMAIL PROTECTED] wrote: > According to the principle of \b why is this doing this? > > $word = "(HP)"; > $word =~ s/[,\]\)\}]\b//; > $word =~ s/\b[,\]\)\}]//; $word = '(HP)'; $word =~ s/^\(|\)$//g; # remove parren @ beginng and end.

Re: VARIABLES

2004-06-18 Thread Paul D. Kraus
perldoc perlvar On Fri, Jun 18, 2004 at 12:38:43PM -0400, [EMAIL PROTECTED] wrote: > All, > > Does perl have built in variable names such as in awk? Here are the ones > in awk > I know perl uses ARGV, but what about: > > ARGC # of command lines arguments > FILENAME name of current input file >

puzzled

2004-06-18 Thread Pedro Antonio Reche
Hi there, I am puzzled by the 'build_seq' subroutine in following code. #!/usr/sbin/perl -w use strict; use vars qw($USAGE); # random sequence generator # # -c=1 option will cause prot sequences to be built # using vertebrate aa frequencies, # with option -a putting a 1st methionine residues on. Fr

RE: VARIABLES

2004-06-18 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > All, > > Does perl have built in variable names such as in awk? Yes, it has many of the same. They are documented in perldoc perlvar. They have short names like $/, $", etc. There is a standard module called English.pm that aliases them to longer names more like the aw

\b confusion

2004-06-18 Thread Murzc
According to the principle of \b why is this doing this? $word = "(HP)"; $word =~ s/[,\]\)\}]\b//; $word =~ s/\b[,\]\)\}]//; Since the parentheses is on either side of the boundary, it should take off bpth of them. Instead the result is:$word = "(HP" It only took of the end paren. When

VARIABLES

2004-06-18 Thread DBSMITH
All, Does perl have built in variable names such as in awk? Here are the ones in awk I know perl uses ARGV, but what about: ARGC # of command lines arguments FILENAME name of current input file FNR record number in current file FS controls the input field separator NF number of fields in curre

Re: correct way to write my own packages

2004-06-18 Thread Randy W. Sims
Joseph Paish wrote: i am using packages to break up a large piece of code into smaller pieces so it is easier to maintain. the following piece of code works : -- this code loads the package #!/usr/bin/perl -w use strict ; # call the packaged code require '/path/to/package/PackageName

First mail

2004-06-18 Thread Sripathi Guruprasannaraj
Hi, This is my first mail to this group. I have been programming in Perl for like 2 years now and would like to help out people and get some help myself. Raj -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: Reading a comma delimited file into an array

2004-06-18 Thread Sripathi Guruprasannaraj
On Fri, 18 Jun 2004 09:30:56 EDT, <[EMAIL PROTECTED]> wrote: Greetings, As a learning Perl Person, this is fun. Would someone please point me in the correct direction to read a comma delimited file and put it into an array? The fields are always in the same position, blank fields will have a

Re: correct way to write my own packages

2004-06-18 Thread Joseph Paish
On Friday 18 June 2004 09:57, Randy W. Sims wrote: > Joseph Paish wrote: -- a bunch of stuff deleted > > i am using packages to break up a large piece of code into smaller pieces > > I'm not sure what you're trying to accomplish. If you are going to have > no subroutines or variables defined for

Re: correct way to write my own packages

2004-06-18 Thread Randy W. Sims
Joseph Paish wrote: i am using packages to break up a large piece of code into smaller pieces so it is easier to maintain. the following piece of code works : -- this code loads the package #!/usr/bin/perl -w use strict ; # call the packaged code require '/path/to/package/PackageName

Re: regex in perl.

2004-06-18 Thread Chris Charley
- Original Message - From: "Rod Za" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 6:15 PM Subject: regex in perl. > Hello, > > Someone know how can i search this in a file using regex? Hello Rod, My head must've been in the clouds

RE: Subroutine return values mixed.

2004-06-18 Thread Khan, Ahmer H
Thank you very much.That did work. A prime example of how painful being a newbie can be :) Ahmer -Original Message- From: Amit Kulkarni [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 11:07 PM To: [EMAIL PROTECTED] Subject: Re: Subroutine return values mixed. HI , You need

RE: printing array elements in columns

2004-06-18 Thread Bob Showalter
N, Guruguhan (GEAE, Foreign National, EACOE) wrote: > Hi All, > I have a one dimensional array @X, containing N elements. I > would like to know how I can print this N elements in M columns? If you want the data to read across, then down, you can do: @X = 'A' .. 'Z'; $m = 8; p

Re: Reading a comma delimited file into an array

2004-06-18 Thread David Dorward
On 18 Jun 2004, at 14:30, [EMAIL PROTECTED] wrote: As a learning Perl Person, this is fun. Would someone please point me in the correct direction to read a comma delimited file and put it into an array? http://search.cpan.org/~alancitt/Text-CSV-0.01/CSV.pm http://search.cpan.org/~jwied/Text-CSV_

RE: CGI.PM and HTML Templates

2004-06-18 Thread Charles K. Clarkson
John Pretti <[EMAIL PROTECTED]> wrote: : Can someone point me in the right direction of converting : the following script to use an html template? You don't need html templates for this. Your pages are static. They don't have any information added to them by the cgi program. You can remove th

Re: Reading a comma delimited file into an array

2004-06-18 Thread Prasanna Kothari
Try this %hashVal; open(FH,"sample.txt")|| die "Could not open $!\n"; @FileLines = ; $i=0; foreach $line (@FileLines) { my @commaLines = split(/,/,$line); $arrval [EMAIL PROTECTED]; $hashVal{$i} =$arrval; $i++; } foreach $keyval (keys %hashVal) { $ra_val = $hashVal{$keyval}; foreach $va

correct way to write my own packages

2004-06-18 Thread Joseph Paish
i am using packages to break up a large piece of code into smaller pieces so it is easier to maintain. the following piece of code works : -- this code loads the package #!/usr/bin/perl -w use strict ; # call the packaged code require '/path/to/package/PackageName.pl' ; PackageName

Re: NT at command

2004-06-18 Thread Goncalves, Jorge (Ext)
Hi List, i have a perl script that adds some Nt at commands but the problem is how can i do to prevent my script to not delete old tasks defined in at. Thanks . -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reading a comma delimited file into an array

2004-06-18 Thread RHug505456
Greetings, As a learning Perl Person, this is fun. Would someone please point me in the correct direction to read a comma delimited file and put it into an array? The fields are always in the same position, blank fields will have a comma. My sample is: header10,header11,,header13 header20,hea

Re: String To Number Conversion

2004-06-18 Thread Paul Johnson
On Fri, Jun 18, 2004 at 06:03:34PM +0530, A Madhusudan-A5324C wrote: > Does anyone know how to convert string into Number in Perl. Just like > the classic atoi function of C. Yep. perl does. If you want something to be a number, use it as one. $ perl -le '$a = "0.36"; $b = "2.456e3 or so"; $c

RE: Subtracting Zero Dates

2004-06-18 Thread Tim Johnson
How about: if($time1 > $time2){ $difference = $time1 - $time2; }else{ die "Invalid date!\n"; } -Original Message- From: Werner Otto [mailto:[EMAIL PROTECTED] Sent: Fri 6/18/2004 5:34 AM To: Tim Johnson; [EMAIL PROTECTED] Cc: Subj

Re: string insertion

2004-06-18 Thread DBSMITH
Lee thanks for the persistence so let me re-explain. Beginners and or Lee, Here is my code my @ejectapes = qw(/usr/local/bin/perld/lvimgGH_ms0_tapes.orig); #($^I, @ARGV) = ('.bak', @ejectapes); open (FILE, "< @ejectapes") or die "cannot open @ejectapes: $!";

Perl hosting

2004-06-18 Thread Ziggy
Is there any hosting service that can host my perl scripts? Perhaps even a free one? -- Visit me. http://ziggy.fateback.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: printing array elements in columns

2004-06-18 Thread Tim Johnson
I can't test this out where I am, but here's one thought... ## my $columns = 5; my $i = 0; while($i < ($#X + $columns)){ for($i..$i+$columns){ print $X[$_]; for(1..(20 - length($X[$_])){ print " "; } } print "\n"; } -O

Re: script

2004-06-18 Thread sreenath sarikonda
Hi venkat, I am new to perl.But you may find this link to be helpful. http://www.hk8.org/old%5Fweb/perl/cookbook/ch16_07.htm --- Vema Venkata <[EMAIL PROTECTED]> wrote: > Hi Group, > > TIA > > Need help > > I have a following path > > "/proj/ahd02/CAisd/sit

Re: Subtracting Zero Dates

2004-06-18 Thread Werner Otto
they are all ready in time format, that is the problem. Example: $time1 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $time2 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $difference = $time1 - $time2; One way: Convert both dates to Perl time() format, then subtract. -Origi

String To Number Conversion

2004-06-18 Thread A Madhusudan-A5324C
Hi All, Does anyone know how to convert string into Number in Perl. Just like the classic atoi function of C. Thanks a lot in advance Madhusudan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: script

2004-06-18 Thread Tim Johnson
Check out the Archive::Zip and Archive::tar modules. -Original Message- From: Vema Venkata [mailto:[EMAIL PROTECTED] Sent: Fri 6/18/2004 2:25 AM To: [EMAIL PROTECTED] Cc: Subject: script Hi Group,

RE: Subtracting Zero Dates

2004-06-18 Thread Tim Johnson
One way: Convert both dates to Perl time() format, then subtract. -Original Message- From: Werner Otto [mailto:[EMAIL PROTECTED] Sent: Fri 6/18/2004 3:28 AM To: [EMAIL PROTECTED] Cc: Subject: Subtracting Zero Dates

Re: printing array elements in columns

2004-06-18 Thread Edward Wijaya
On Fri, 18 Jun 2004 17:08:08 +0530, N, Guruguhan (GEAE, Foreign National, EACOE) <[EMAIL PROTECTED]> wrote: Hi All, I have a one dimensional array @X, containing N elements. I would like to know how I can print this N elements in M columns? print join("\n", @X), "\n"; Or if you hav

printing array elements in columns

2004-06-18 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All, I have a one dimensional array @X, containing N elements. I would like to know how I can print this N elements in M columns? TIA Guruguhan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Subtracting Zero Dates

2004-06-18 Thread Werner Otto
Hi All, Does anyone know how to handle subtracting two dates where one might be 0 or no time or blank? -- Kind Regards, Werner Otto -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: array

2004-06-18 Thread WilliamGunther
In a message dated 6/18/2004 3:37:17 AM Eastern Standard Time, [EMAIL PROTECTED] writes: >- is it possible to search an array for a certain element, and that the >search returns the element index? eg. searching for 156 in the array >(123, 456, 156, 1354, 35164, 654656, 654, 846) should give 2 Lo

Re: getting online information....

2004-06-18 Thread Zeus Odin
This email follows this format: 1. Suggestions and items you need to read in order to understand the code are listed first. 2. Suggestions about properly posting a question are next. 3. Finally, the code that does all that you ask is at the bottom. 1. Please read or do the following: (a) ALWAYS

nested foreach not looping

2004-06-18 Thread mike re-v
The following code iterates unexpectedly. I want to loop thru the file 'file.dat' and pull out every field that begins with 650. The code then pulls the 650 field and builds an array from the sub-fields. The code works but I'm stuck on the first record. In other words if the file I'm reading has

script

2004-06-18 Thread Vema Venkata
Hi Group, TIA Need help I have a following path "/proj/ahd02/CAisd/site/mods/scripts/log" in this path i have a file called "archive-18-7-2003.tar.Z" I want a script in perl by uncompress and untar it. can any send me the same requested.

regular exp

2004-06-18 Thread jack jack
ALL, I have 2 variables $last_accessed and $owner_line $last_accessed=": Last accessed 20-Apr-04.12:57:30 by [EMAIL PROTECTED]"; $owner_line="Owner: opc_bld : rwx (all)"; -From $last_accessed i want the foll output in variables : $view_day=20 $view_month=Apr $view_year=04 -From

regular expression- help

2004-06-18 Thread jack jack
Hi All, I have 2 variables $last_accessed and $owner_line $last_accessed=": Last accessed 20-Apr-04.12:57:30 by [EMAIL PROTECTED]"; $owner_line="Owner: opc_bld : rwx (all)"; -From $last_accessed i want the foll output in variables : $view_day=20 $view_month=Apr $view_year=04 -From

Re: Microsoft Word and Perl

2004-06-18 Thread Ilaiy
When i use my $newdoc = $word->ActiveDocument; foreach my $obj_Story ($newdoc->StoryRanges ){ $obj_Story->Fields->Update();line 10 while (my $obj_Story = $obj_Story->NextStoryRange){ $obj_Story->Fields->Update(); } #$obj_Story->NextStoryRange; I get the following Win32::OL

Re: a way to make this more secured and better written?

2004-06-18 Thread Jason Gray
So would this solve the problem? check_fields($q); sub check_fields { my $q = shift; my @fields = qw(name email city state message); foreach my $field (@fields) { next if ($q->param($field)); print 'Please fill in the blank fields.'; exit; } unless (Email::Valid->address($q->param('ema

RE: array

2004-06-18 Thread Tim Johnson
-Original Message- From: Stefan Weckx [mailto:[EMAIL PROTECTED] Sent: Friday, June 18, 2004 1:38 AM To: [EMAIL PROTECTED] Subject: array >hi list, >2 questions about arrays: >- I want to take 2 elements a time from an array within a foreach >control structure, which should be somethin

array

2004-06-18 Thread Stefan Weckx
hi list, 2 questions about arrays: - I want to take 2 elements a time from an array within a foreach control structure, which should be something like: foreach $a $b (@array) {...}. it this possible in perl?? - is it possible to search an array for a certain element, and that the search returns t

Re:seach a number in a file

2004-06-18 Thread Goncalves, Jorge (Ext)
Hi, I have a text file like this: 1 Chaque L Ma Me J V S D 00:20 D:\muse\lotus\notes\extractStat.exe StatA090 j 2 Chaque L Ma Me J V S D 00:21 D:\muse\lotus\notes\extractStat.exe StatA090 m 3 Chaque L Ma Me J V S D 00:22 D:\muse\lotus\notes\extractStat.exe StatA090