Re: line feeds in perl scripts

2002-11-06 Thread Felix Geerinckx
on Tue, 05 Nov 2002 19:19:37 GMT, [EMAIL PROTECTED] (Sean Finnigan) wrote: > What is the best way to replace line feeds in perl scripts that I > copy from my PC to my Unix machine? They don't run on the Unix > side unless I open an editor and find/replace the line > feeds/carriage returns. htt

inport c library

2002-11-06 Thread dudy rudianto
hello there, can anyone show me how to import c library in perl program. does perl use curses.h in c? regards dudy r -- Powered by Outblaze -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

writing to log from perl script

2002-11-06 Thread K Pfeiffer
Hi, I was reading up today on syslog and it gave the following shell script example of how to set up a logging service: $ logger -p local5.info "Script terminated normally" I was wondering what the best way might be to do this from a perl script that runs periodically - have it append directly

Re: Fork Question

2002-11-06 Thread John W. Krahn
Jessee Parker wrote: > > Using Perl on a Linux system, is there a way to fork off x amount of copies > then make a system wait until those copies are finished before forking off > more copies? If so can you show me an example if possible. It would be > greatly appreciated! TIA http://www.stonehen

File version info - vs_version_info

2002-11-06 Thread Gary Hawkins
Hello everybody, The script below uses three Windows API's in version.dll to obtain file version information. I have been testing with this command line: GetFileVersionInfo.pl c:\windows\twunk_32.exe The basic file information works fine, but there is also a subblock that has me at the end of m

Re: Mail::Sendmail Module

2002-11-06 Thread Gary Stainburn
On Tuesday 05 November 2002 5:37 pm, LRMK wrote: > there is a one problem > $mail{message}=; only reads the first line of the file > in the following block; > > $oldsep=$/; $/=undef; disable line seperation > open(FIN,"")||die "cannot open file: $!\n"; > $mail{message}=; > close(FIN); > $/=$

Re: Mail::Sendmail Module

2002-11-06 Thread Gary Stainburn
On Tuesday 05 November 2002 5:47 pm, Kipp, James wrote: > > Hello everyone, > > > > I'm trying to use the Mail::Sendmail module in a script where I need a > > independent mailer. The problem I'm having is including more > > than one line > > of text in the message body. I'm not really sure how to

Re: Mail::Sendmail Module

2002-11-06 Thread Paul Johnson
Gary Stainburn said: > On Tuesday 05 November 2002 5:37 pm, LRMK wrote: >> there is a one problem >> $mail{message}=; only reads the first line of the file >> in the following block; >> >> $oldsep=$/; $/=undef; disable line seperation >> open(FIN,"")||die "cannot open file: $!\n"; >> $mail{me

replace strings and preserve case

2002-11-06 Thread David Garamond
is there a short recipe to do this in perl? i want to replace all "die" with "paint" and preserve case (i.e. "Die" should be replaced by "Paint", "DIE" by "PAINT", and so on). there's a smart snippet on TPJ to do this: $string =~ s/($x)/"\L$y"^"\L$1"^$1/ie; but it only works if the replacemen

RE: writing to log from perl script

2002-11-06 Thread wiggins
Check out: Sys::Syslog (standard module) for simple stuff, or for the ultimate control you might check out the following: http://log4perl.sourceforge.net/ http://danconia.org On Wed, 6 Nov 2002 00:42:10 +0100, K Pfeiffer <[EMAIL PROTECTED]> wrot

Re: replace strings and preserve case

2002-11-06 Thread John W. Krahn
David Garamond wrote: > > is there a short recipe to do this in perl? i want to replace all "die" > with "paint" and preserve case (i.e. "Die" should be replaced by > "Paint", "DIE" by "PAINT", and so on). there's a smart snippet on TPJ to > do this: > > $string =~ s/($x)/"\L$y"^"\L$1"^$1/ie; >

Re: Perl Unix Binary Files

2002-11-06 Thread John Pitchko
How so? Using unpack('b*', $data) to change it into a bitstring and pack('b*', $data) to change it back to ASCII??? --- John Pitchko 3rd Year Computer Science - University of Regina Systems Trainee - Data Services - SGI A

RE: Mail::Sendmail Module

2002-11-06 Thread Kipp, James
> > > Always try to do things within perl. Using the backticks to > system() the > external cat command will work only if the cat command exists > and is in the > $PATH. Also, it is less efficient as it involves forking > another process and > execing another file. > > While this may not

Re: Trouble installing GD.pm

2002-11-06 Thread zentara
On Tue, 5 Nov 2002 08:55:26 -0800, [EMAIL PROTECTED] (Todd Shifflett) wrote: >Using: Mac OSX 10.2 >libgd 2.0.4 > >Can anyone help me make something of this? >when I try and install GD.pm I get the following errors: > > >cc -c -I/sw/include -I/usr/local/include/gd -I/usr/lib >-I/System/Li

Re: inport c library

2002-11-06 Thread Steve Grazzini
Dudy Rudianto <[EMAIL PROTECTED]> wrote: > can anyone show me how to import c library in perl program. You usually need to write some glue with XS. Have a look at: $ perldoc perlxstut Or the SWIG and Inline XS-generators: http://www.swig.org http://search.cpan.org/author/INGY/Inline-0.4

explicit package name errors

2002-11-06 Thread Johnson, Shaunn
Howdy: Can someone tell me why I keep getting the errors: [snip error] D:\PERL\BIN\MY_SCPTS>db2_test1.pl syntax error at D:\PERL\BIN\MY_SCPTS\db2_test1.pl line 35, near "my" Global symbol "$sth" requires explicit package name at D:\PERL\BIN\MY_SCPTS\db2_ test1.pl line 35. Global symbol "$sql" requ

Re: explicit package name errors

2002-11-06 Thread Paul Johnson
Johnson, Shaunn said: > Howdy: > > Can someone tell me why I keep getting the errors: > [snip error] > D:\PERL\BIN\MY_SCPTS>db2_test1.pl > syntax error at D:\PERL\BIN\MY_SCPTS\db2_test1.pl line 35, near "my" > Global symbol "$sth" requires explicit package name at > D:\PERL\BIN\MY_SCPTS\db2_ > tes

Re: Split a file

2002-11-06 Thread Robert Citek
Hello Johnny, At 12:31 PM 11/4/2002 -0500, Johnny Hall wrote: >I am trying to take a file of variable length on a daily basis and >divide it up into 4 equal parts for processing on each file. Does >someone have an easy way to do this? Did not read your attachment since my mail processor remov

How to call a NT module ( ADMIN.EXE from EXCHANGE)

2002-11-06 Thread Pascal TRONQUET
I'm new with PERL and I first looked at the FAQ with ACTIVEPERL. I've been trying for than one hour to figure out to call ADMIN.EXE from my PERL. How to do that ? Regards. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to call a NT module ( ADMIN.EXE from EXCHANGE)

2002-11-06 Thread Timothy Johnson
There are basically three ways to call an external program from Perl. system()-- Launches the program given as a parameter and returns the exit code. `` (backticks) -- Launches the program inside the backticks and returns the output. exec()-- Launches the program given as

Re: Files at different location

2002-11-06 Thread Paul Johnson
dan said: > well i could spend ample amount of time testing code for someone else. > like everyone else here, i'm only offering suggestions on how a problem > can be overcome. seriously, if someone is trying to create a perl > script, they'll have at least some knowledge in perl on how to fix > er

Re: linux pearl??

2002-11-06 Thread Jenda Krynicky
From: stacy wilmshurst <[EMAIL PROTECTED]> > hey can someone give me a tip to where i can find the pearl > packages on redhat8? > i'm getting real confused trying to set them up > but i know they're there... well this mailing list is about Perl. We can't help you with "pearl".

maybe a db2 question

2002-11-06 Thread Johnson, Shaunn
Howdy: This may be a DB2 question; if so, let me know and I'll send the question there - I have a script that connects to the mainframe and generates a flat file with data that I want. Works fine for what I'm doing. But now I want to create the outfile in an IXF format, somehow. I'm looking at

Re: linux pearl??

2002-11-06 Thread Robert Citek
Hello Stacy, At 07:56 PM 11/5/2002 -0800, stacy wilmshurst wrote: >hey can someone give me a tip to where i can find the pearl >packages on redhat8? >i'm getting real confused trying to set them up >but i know they're there... > >help please Since this is a perl list, I am assuming you meant "pe

RE: explicit package name errors

2002-11-06 Thread ss004b3324
Hi Shaunn, > my $sql="SELECT > name, > tbname > from sysibm.syscolumns > where tbname = 'local_table'; --^ You forgot the closing double quotes. You either need to have the query all on one line or concatenate it: my $sql = ( "SELECT name, tbname FROM sysibm.syscolumn

RE: linux pearl??

2002-11-06 Thread Charlotte Oliver
> If you purchased RH8.0, then your best resource is to call > Red Hat. They have very good technical support and will > guide you. Their manuals are also very good. If you got the > CD's from your local Linux Users Group, then they would be > the best people to ask. If you downloaded the C

PerlTk in RedHat8.0

2002-11-06 Thread Leroy Hogan
My first post here. Has anyone upgraded to RedHat8.0 and then discover your PerlTk-8.15.1 gui interfaces not working? I get a "can't load Event.so for module TK and something about an undefined symbol. Roy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

RE: linux pearl??

2002-11-06 Thread Robert Citek
At 01:43 PM 11/6/2002 -0500, Charlotte Oliver wrote: >You could also try "locate perl" or "whereis perl" on the command line. >Usually it's someplace like \usr\bin\perl, though. > >I don't run Redhat though, so your mileage may vary. 'locate' and 'whereis' work only if perl is already installed.

RE: linux pearl??

2002-11-06 Thread Charlotte Oliver
> At 01:43 PM 11/6/2002 -0500, Charlotte Oliver wrote: > >You could also try "locate perl" or "whereis perl" on the > command line. > >Usually it's someplace like \usr\bin\perl, though. > > > >I don't run Redhat though, so your mileage may vary. > > 'locate' and 'whereis' work only if perl is a

How do I update a single instance of a repeatable element in a xml document?

2002-11-06 Thread Melanie Rouette
Hi, If I have something like: Father Brian Mother Elisabeth Sister Judy brother Lathan and I want to update the Sister Judy element only, based on the fact that I want to update only the element that has the word "Sister" in it's text content. (Let's say I want to change the name

How do I update a single instance of a repeatable element in a xml document?

2002-11-06 Thread Melanie Rouette
Melanie Rouette wrote: Hi, If I have something like: Father Brian Mother Elisabeth Sister Judy brother Lathan and I want to update the Sister Judy element only, based on the fact that I want to update only the element that has the word "Sister" in it's text content. (Let's say I

Re: Run a perl script within perl....

2002-11-06 Thread Chris (?)
Sure thing buddy! Just go to http://search.cpan.org/author/GBARR/libnet-1.12/Net/FTP.pm It's all there. At 08:41 PM 11/6/02 +0530, you wrote: will u pls write me something about this Net::FTP , & from where i can read about it my $ftp = Net::FTP->new($ftpHost, Debug => 1) || die "Unable to co

Getting a http redirected page

2002-11-06 Thread Beau E. Cox
Mi - I'm using LWP::UserAgent to get web content: my $request = new HTTP::Request ('GET' => $url); my $response = $agent->request ($request); Now I get a response of 500 (page redirected). I can't seem to remember how to get the new location... something like: get raw headers and the new url

RE: could 5.8 make a difference in place of 5.6 ?

2002-11-06 Thread Jenda Krynicky
From: Aman Thind <[EMAIL PROTECTED]> > 5.8 is perfectly backward compatible and no exception has been thrown > in my period of it's usage. I have recently upgraded from 5.6.1 to 5.8 > and my old scripts run perfecly fine. So any script that is good enuff > for 5.6 is good enuff f

Re: Getting a http redirected page

2002-11-06 Thread Jenda Krynicky
From: "Beau E. Cox" <[EMAIL PROTECTED]> > I'm using LWP::UserAgent to get web content: > > my $request = new HTTP::Request ('GET' => $url); > my $response = $agent->request ($request); > > Now I get a response of 500 (page redirected). > > I can't seem to remember how to get the new location..

die not working

2002-11-06 Thread Johnstone, Colin
Gidday all, I assume when using die in this format I should see the error message. #!/usr/bin/perl use CGI qw( :standard ); print header(); $file1 = /web/schooled/www/news/subscribers_news1.txt open IN, "<$file1" or die("Cannot Open: $!"); while( my $record = ){ chomp $record; @data = spl

RE: die not working

2002-11-06 Thread Nikola Janceski
add this: use CGI::Carp 'fatalsToBrowser'; > -Original Message- > From: Johnstone, Colin [mailto:Colin.Johnstone@;det.nsw.edu.au] > Sent: Wednesday, November 06, 2002 4:18 PM > To: '[EMAIL PROTECTED]' > Subject: die not working > > > Gidday all, > > I assume when using die in this form

RE: die not working

2002-11-06 Thread Johnstone, Colin
Thanks Nicola, it didn't work though I get this error now. Software error: syntax error at /web/schooled/cgi-bin/optin.cgi line 36, next char ) Execution of /web/schooled/cgi-bin/optin.cgi aborted due to compilation errors. heres the edited code #!/usr/bin/perl use CGI qw( :standard ); use CGI

RE: die not working

2002-11-06 Thread Scott, Joshua
Change your open line to read as follows: open (IN,"$file1") or die("Cannot Open: $!"); Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: Johnstone, Colin [mailto:Colin.Johnstone@;det.nsw.edu.au] Sent: Wednesday, November 06, 2002 1:25 PM To: 'Nikola Ja

RE: Getting a http redirected page

2002-11-06 Thread Beau E. Cox
Thanks Jenda - You pointed me to my error (I had a messed-up url). Aloha => Beau. -Original Message- From: Jenda Krynicky [mailto:Jenda@;Krynicky.cz] Sent: Wednesday, November 06, 2002 11:16 AM To: Beginners Perl Subject: Re: Getting a http redirected page From: "Beau E. Cox" <[EMAIL P

Hash Sorting?

2002-11-06 Thread Kurtis
Hello all.. Does anyone know how to sort a hash in ascending order on the value? If possible, a little example! Thanks, Kurtis

RE: Hash Sorting?

2002-11-06 Thread Timothy Johnson
You can use the longer form of sort for this. You may have seen this before: my @array = sort {$a cmp $b} @unsorted; #$a and $b are default variables for the sort command. #to reverse sort, you can reverse $a and $b. You can also do this: foreach(sort {$hash{$a} cmp $hash{$b}} keys $hash){

Declaring a Hash

2002-11-06 Thread Johnstone, Colin
Gidday all, How does one declare a hash our $hash = (); Colin Johnstone

RE: Hash Sorting?

2002-11-06 Thread Perry, Alan
I think the second example should be: foreach(sort {$hash{$a} cmp $hash{$b}} keys %hash){ do something... } Notice the %hash (and not $hash) at the end. -Original Message- From: Timothy Johnson [mailto:tjohnson@;sandisk.com] Sent: Wednesday, November 06, 2002 17:07 To: 'Kurtis'; [EMAI

RE: Hash Sorting?

2002-11-06 Thread Timothy Johnson
Right you are. sorry. -Original Message- From: Perry, Alan [mailto:aperry@;loislaw.com] Sent: Wednesday, November 06, 2002 3:17 PM To: [EMAIL PROTECTED] Subject: RE: Hash Sorting? I think the second example should be: foreach(sort {$hash{$a} cmp $hash{$b}} keys %hash){ do something

RE: Declaring a Hash

2002-11-06 Thread Johnstone, Colin
Thank you all, -Original Message- From: Scott, Joshua [mailto:Joshua.Scott@;Jacobs.com] Sent: Thursday, November 07, 2002 10:15 To: Johnstone, Colin Subject: RE: Declaring a Hash Hello, Here is how you declare hash. my %hash = (); Joshua Scott Security Systems Analyst, CISSP 626-568-

RE: Declaring a Hash

2002-11-06 Thread Timothy Johnson
That would be our %hash = (); Remember that when you assign a value to a hash, you supply a list of keys and values separated by commas (or the => operator in place of a comma, if you prefer). So if you supply an empty list you are declaring an empty hash. -Original Message- From: Joh

fetch data from having multiple

2002-11-06 Thread aman cgiperl
I have a form that looks like this When I click on one of the images, the hidden value of xyz get carried over to the fetch.cgi as param(xyz) How can I determine whether img name aaa or bbb was clicked? Thanks alot Aman -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: fetch data from having multiple

2002-11-06 Thread Kurtis
You can try JavaScript.. Replace the image from an INPUT type to an HREF and get rid of the form. Within the href of each image put this.. href="javascript: go_to('fetch.cgi?xyz=abc;image=aaa')" href="javascript: go_to('fetch.cgi?xyz=abc;im

Re: Hash Sorting?

2002-11-06 Thread Kurtis
Hey Timothy, I couldn't get it to work...I know you can sort on keys, so I went out the cheap wayI switched the values with my keys...it's no problem because my values are unique also If anyone is interested... as sort on keys... foreach $key (sort keys %hash) { $va

RE: Hash Sorting?

2002-11-06 Thread Timothy Johnson
How about this: ## my %hash = (alpha => 'one', beta => 'two', gamma => 'zero', zeta => 'cheese'); print "Sorted:\n"; foreach(sort {$hash{$a} cmp $hash{$b}} keys %hash){ print " $_ => $hash{$_}\n"; } print "\n"; print "Unsorted:\n"; foreach(keys %hash)

Re: [CGI] fetch data from having multiple

2002-11-06 Thread aman cgiperl
Sorry that I did not mention that aaa and bbb are just examples. I won't actually know the expected names, as they are generated at run-time by a cgi script. Thanks Aman - Original Message - From: "Sales Department" <[EMAIL PROTECTED]> To: "aman cgiperl" <[EMAIL PROTECTED]> Sent: Wednesda

Re: fetch data from having multiple

2002-11-06 Thread Todd W
Message rearranged because of jepoardy style posting... - Original Message - From: "aman cgiperl" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 6:42 PM Subject: fetch data from having multiple I have a form that looks like thi

sending EOF

2002-11-06 Thread Mark Goland
Hi guys, In my script I am need to send an explicit EOF to another program, I open inside my script. Something like this... open FH,"| prog that runs"; print FH "blah blah"; print FH "EOF" # send program EOF. I tryd closing the handle , but that didnt work. Any Idea's ?? Thanx in advance, Mar

RE: [CGI] fetch data from having multiple

2002-11-06 Thread Moon, John
print $q->start_form(-name=>'form1', -onSubmit=>"return validateForm()") print $q->hidden(-name=>'passit', -value=>'xxx'); print $q->img({-src=>'../../Graphics/somepic1.gif', -onClick=>'form1.passit.value="aaa";'}); print $q->img({-src=>'../../Graphics/somepic2.gif',

Win32::DriveInfo

2002-11-06 Thread HENRY,MARK (HP-Roseville,ex1)
Hi All, Has anyone been able to download Win32::DriveInfo via ppm? I've tried a few different ppm servers with no luck.. Thanks, Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sending EOF

2002-11-06 Thread John W. Krahn
Mark Goland wrote: > > Hi guys, Hello, > In my script I am need to send an explicit EOF to another program, I open > inside my script. Something like this... > > open FH,"| prog that runs"; > > print FH "blah blah"; > > print FH "EOF" # send program EOF. > > I tryd closing the handle , but t

rcp says permission denied , or unknown host

2002-11-06 Thread PRADEEP GOEL
system("rcp $workdir/installP.pl $remhost:installP.pl"); says permission denied i am not much familier with rcp i have tried several combination such as applying " root@ " before $workdir etc sometimes it says permission denied or else it says unknown host machine on which i am writ

pattern

2002-11-06 Thread Javeed SAR
> Hi all, > I want to input a string which is used to create file name, and I want to > allow input string to consist of letters(SDK) at the start and only IR and > DEV inbetween, and numbers(0-9) and > underscore( _ ) within file name. > Is the pattern right. > m/^SDK[0-9]|^SDK_[0-9]|^SDK_[0-

pattern

2002-11-06 Thread Javeed SAR
Hi all, I want to input a string which is used to create file name, and I want to allow input string to consist of letters(SDK) at the start and only IR and DEV inbetween, and numbers(0-9) and underscore( _ ) within file name. Is the pattern right.

RE: pattern

2002-11-06 Thread Aman Thind
Could you give some examples of legitimate filenames of all varieties you want ? that would help me \ us to make unambiguous test cases to ascertain your regex and suggest improvements... -aman. -Original Message- From: Javeed SAR [mailto:SAR.Javeed@;sisl.co.in] Sent: Thursday, November