Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Larry Wissink
Hi, I thought this would be simple... I want to supply the name of a file on the command line when executing a script. Unfortunately, I'm getting an error that says that @ARGV is uninitialized. How do you initialize @ARGV? How do you specify command line arguments? I'm using Windows XP, ac

Re: help needed--query

2004-06-03 Thread John W. Krahn
Sidharth wrote: > > hi all, Hello, > i am new to this group. Please set your software to limit line lengths to less than 80 characters and use plain ASCII text instead of quoted-printable MIME. > hope get maximum benifit out of this group. > currently i am writting a script wherein i ha

Re: unpack() help

2004-06-03 Thread John W. Krahn
Rmck wrote: > > Hi Hello, > I have the .h file of a program that spits out a data file > which is Binary Output. The binary file is a series of fixed > length records. In C, each record has the format which is > in the script. > > I thought I could use unpack to read the data, and I am > havin

Re: Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Jeff 'japhy' Pinyan
On Jun 2, Larry Wissink said: >I want to supply the name of a file on the command line when executing a >script. Unfortunately, I'm getting an error that says that @ARGV is >uninitialized. > >How do you initialize @ARGV? How do you specify command line arguments? You don't initialize @ARGV. It

splitting with special characters

2004-06-03 Thread Singh, Ajit p
Hello All, I am trying to split a string with the / ( forward slash) as the marker. $mystring = "abcde/fghi" split (///,$mystring) -- gives me compile error split (/\//,$mystring) -- gives me abcdefghi how do i specify / as the delimitter.

Re: splitting with special characters

2004-06-03 Thread James Edward Gray II
On Jun 3, 2004, at 8:11 AM, Singh, Ajit p wrote: Hello All, I am trying to split a string with the / ( forward slash) as the marker. $mystring = "abcde/fghi" split (///,$mystring) -- gives me compile error split (/\//,$mystring) -- gives me abcdefghi I hope not. The second one is fine: > perl

RE: splitting with special characters

2004-06-03 Thread Cristi Ocolisan
Hi Singh, Try this: $mystring = "abcde/fghi"; @a = split (/\//, $mystring); print "$a[0]\n"; print "$a[1]"; Regards, Cristi Ocolisan -Original Message- From: Singh, Ajit p [mailto:[EMAIL PROTECTED] Sent: 3 iunie 2004 16:11 To: Singh, Ajit p; [EMAIL PROTECTED] Subject: splitting with

Re: splitting with special characters

2004-06-03 Thread Ramprasad A Padmanabhan
Works for me #!/usr/bin/perl # # use strict; use Data::Dumper; my $mystring = "abcde/fghi"; my @a = split (/\//,$mystring); print Dumper([EMAIL PROTECTED]); __END__ OUTPUT $VAR1 = [ 'abcde', 'fghi' ]; Ram On Thu, 2004-06-03 at 18:41, Singh, Ajit p wrote: > Hel

Re: splitting with special characters

2004-06-03 Thread Mandar Rahurkar
I think whats happening is your printing the entire array @result_from_split...do @result_from_split[0] and so on.. Mandar Original message >Date: Thu, 3 Jun 2004 08:19:45 -0500 >From: James Edward Gray II <[EMAIL PROTECTED]> >Subject: Re: splitting with special characters >To: "Si

Re: Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Dennis G. Wicks
Greetings; Are you using ActiveState perl? I just did extensive testing using ActiveState perl on XP-Pro and I get the exact same results. C:\DATAFI~1>argv.pl testfile gives the unitialized variable message but C:\DATAFI~1>perl argv.pl testfile works as expected. I also teste

RE: splitting with special characters

2004-06-03 Thread NYIMI Jose (BMB)
> -Original Message- > From: Singh, Ajit p [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 03, 2004 3:11 PM > To: Singh, Ajit p; [EMAIL PROTECTED] > Subject: splitting with special characters > > > Hello All, > > I am trying to split a string with the / ( forward slash) as > the marke

Module help (local variables in seperate directory)

2004-06-03 Thread Andrew Koebrick
I am having trouble creating a modules which splits its functions and variables between two files in two separate directories. I want to have a set of global functions (i.e. open database connection...) which would live in the main Perl path, and a local configuration file (containing Host name,

RE: Module help (local variables in seperate directory)

2004-06-03 Thread Bob Showalter
Andrew Koebrick wrote: > I am having trouble creating a modules which splits its functions and > variables between two files in two separate directories. > > I want to have a set of global functions (i.e. open database > connection...) which would live in the main Perl path, and a local > configu

how to execute make command

2004-06-03 Thread Sidharth
hi all, i want to know how to execute makefile from the perl script ,its a sort of urgent . thank u all in advance... - "There is nothing in a caterpillar that tells

RE: how to execute make command

2004-06-03 Thread Hanson, Rob
Thre ways... exec('make'); system('make'); `make`; The three differ slightly, you might want to check the docs. Breifly... exec - executes the command, but your Perl program ends where it is. system - executes the command, waits for it to finish, returns the return code. `` (backticks) - execut

printing contents between lines

2004-06-03 Thread Sidharth
hi all , consider the contentes of file as below === tools: # Phony target (prerequisite of .PHONY). # Implicit rule search has not been done. # File does not exist. # File has not been updated. # commands to execute (from `Makefile', line 52): @$(ECHO)

RE: using Mail::Sendmail

2004-06-03 Thread DBSMITH
I was looking at the Mail::Sendmail module from CPAN and I did not find anything that showed printing a body. How do I print a body of text data from a variable? The highlighted code is not working but I was playing with it to get this message with the scaler $ftapes listed. thank you! ## Se

RE: using Mail::Sendmail

2004-06-03 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I was looking at the Mail::Sendmail module from CPAN and I did not > find anything that showed printing a body. How do I print a body of > text data from a variable? I haven't used Mail::Sendmail, but it looks like the message body goes in the Message entry of the hash

running slow...

2004-06-03 Thread MCMULLIN, NANCY
Can anyone tell me what is slowing down my script below? The SQL statement by itself executes in less than a second (outside of this Perl program), but this script takes about 10 seconds to come up.. Note: I'm just learning, so I'm sure there's a lot that could be improved... Thanks. Nancy -

Re: running slow...

2004-06-03 Thread Wiggins d Anconia
> Can anyone tell me what is slowing down my script below? The SQL statement by itself executes in less than a second (outside of this Perl program), but this script takes about 10 seconds to come up.. > > Note: I'm just learning, so I'm sure there's a lot that could be improved... > Gonna nee

RE: running slow...

2004-06-03 Thread MCMULLIN, NANCY
I'm sorry... here it is = #!c:/activeperl/bin/perl use strict; use warnings; use DBI; use DBD::Oracle; use CGI qw(:standard *table *Tr ); use CGI::Carp qw(fatalsToBrowser); my $dbh = DBI->connect('DBI:Oracle:sid', 'uid', 'pw') || die "Couldn't connect to database: " . DBI->errs

Re: printing contents between lines

2004-06-03 Thread John Harrington
How about: my $myvar = qq(); $myvar=~s/tools:(.*?)# Not a//sg; print $1; John From: "Sidharth" <[EMAIL PROTECTED]> > hi all , > consider the contentes of file as below > > === > tools: > # Phony target (prerequisite of .PHONY). > # Implicit rule s

RE: using Mail::Sendmail

2004-06-03 Thread DBSMITH
ok here it what I did and it is emailing sproadically. Also it is not placing the array data into the email body??? ## Set pragmas use strict; use Mail::Sendmail; ## Set and edit variables my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'};

Re: Loading Scalar Vars with Text - Readability

2004-06-03 Thread Zeus Odin
If "Clause" is literal and the numbers are in numerical order from A to N (where both A and N are known), I would use: my $longlist = join '|', map { "Clause$_" } (1..20); If "Clause" is literal and the numbers are not numerical: my $longlist = join '|', map { "Clause$_" } qw(5 20 3 6 9 11 7 13

Re: printing contents between lines

2004-06-03 Thread Chris Charley
- Original Message - From: "Sidharth" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Thursday, June 03, 2004 3:44 PM Subject: printing contents between lines hi all , consider the contentes of file as below [snip file contents] how to print all the li

Re: printing contents between lines

2004-06-03 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Thursday, June 03, 2004 7:09 PM Subject: Re: printing contents between lines > > - Original Message - > From: "Sidharth" <[EMAIL PROTECTED]> > Newsgroups: per

looking for a specific "howto" example with Mail::IMAPClient

2004-06-03 Thread new2code
hi, i've inherited my company's mail server (the tech guy quit), and i need to manage a 'cleanup'. in doing so, i've come to understand that a perl script will best do what i need. as i'm new to perl, i'm hoping to get help with a specific howto example from someone here that'll get me started ..

Looking for "\n" shortcut.

2004-06-03 Thread Dennis G. Wicks
Greetings; Is there a shortcut or option or something that will let me not have to type "\n"; so often? I am not the worlds best typist and I need all the help I can get! Many TIA, Dennis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Looking for "\n" shortcut.

2004-06-03 Thread Randy W. Sims
On 6/3/2004 10:54 PM, Dennis G. Wicks wrote: Greetings; Is there a shortcut or option or something that will let me not have to type "\n"; so often? I am not the worlds best typist and I need all the help I can get! You can use here-documents (see `perldoc perldata`) print < you could also define a

RE: printing contents between lines

2004-06-03 Thread Tim Johnson
Here's another way to do it, and the nice thing about this way is that you can reuse the sub later. This subroutine will print every line starting after the $start phrase and until it finds the $end phrase. ### PrintSection("myfile.txt","tools:","not a ta

RE: Looking for "\n" shortcut.

2004-06-03 Thread Charles K. Clarkson
Randy W. Sims wrote: : On 6/3/2004 10:54 PM, Dennis G. Wicks wrote: : : You can use here-documents (see `perldoc perldata`) : : print < "\n"; : : print 'Hello,' . eol; : print 'world' . eol; You can also change the value of $\ to "\n": $\ = "\n"; print 'Hello,';