Re: Delete an element in an array

2005-02-25 Thread Oliver Fuchs
On Mon, 21 Feb 2005, Bob Showalter wrote: > Oliver Fuchs wrote: > >Hi, > > > >I want to save names from to an array. > >Afterwards I want to delete a single name in the array received again > >from . > > > >This is what I have: > > > >#!/usr/bin/perl > > > >use warnings; > > We always recommend:

Re: Delete an element in an array

2005-02-25 Thread Oliver Fuchs
On Mon, 21 Feb 2005, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > Oliver Fuchs wrote: > > Hi, > > > > I want to save names from to an array. > > Afterwards I want to delete a single name in the array received again > > from . > > > > This is what I have: > > > > #!/usr/bin/perl

Re: Perl error --> Global symbol requires...

2005-02-25 Thread JupiterHost.Net
Owen wrote: On Fri, 25 Feb 2005 15:55:21 -0700 "Bret Goodfellow" <[EMAIL PROTECTED]> wrote: # while1.pl use strict ; use warnings ; $i = 1; while ($i < 10) { print "I am at $i\n"; i++; } # while1.pl Global symbol "$i" requires explicit package name at Try removing the 'use strict;' statement. See w

Re: Perl error --> Global symbol requires...

2005-02-25 Thread John W. Krahn
Owen wrote: On Fri, 25 Feb 2005 15:55:21 -0700 "Bret Goodfellow" <[EMAIL PROTECTED]> wrote: # while1.pl use strict ; use warnings ; $i = 1; while ($i < 10) { print "I am at $i\n"; i++; } # while1.pl Global symbol "$i" requires explicit package name at Try removing the 'use strict;' statement. See w

Re: Perl error --> Global symbol requires...

2005-02-25 Thread Xiaofang Zhou
Hi, Bret You must tell perl what kinds of var the $i is, when 'use strict'. $i can be a lexical var or a global var. my $i = 1; # $i is a lexical var. our $i = 1; # $i is a global var, perl 5.6+ only. use vars qw($i); # also as global var, but can work under old perl 在 2005-02-25 15:55:00

Re: Perl error --> Global symbol requires...

2005-02-25 Thread Owen
On Fri, 25 Feb 2005 15:55:21 -0700 "Bret Goodfellow" <[EMAIL PROTECTED]> wrote: > # while1.pl > use strict ; > use warnings ; > > $i = 1; > > while ($i < 10) { > print "I am at $i\n"; > i++; > } > # while1.pl > > > > Global symbol "$i" requires explicit package name at Try removing t

RE: Calling Files automatically

2005-02-25 Thread Charles K. Clarkson
Edward WIJAYA <[EMAIL PROTECTED]> wrote: : On Fri, 25 Feb 2005 09:10:54 -0600, Charles K. Clarkson : <[EMAIL PROTECTED]> wrote: : : : Is it always data1, data2, data3, etc. or can data be : : another word? (Like foo1, foo2, foo3, etc.) : : : : it always comes in (R-P) pair: : data1R.fa : d

Re: Calling Files automatically

2005-02-25 Thread Edward WIJAYA
Thanks for your reply Charles, On Fri, 25 Feb 2005 09:10:54 -0600, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: Is it always data1, data2, data3, etc. or can data be another word? (Like foo1, foo2, foo3, etc.) it always comes in (R-P) pair: data1R.fa data1P.fa foo1R.fa foo1P.fa bar2R.fa ba

"COPY FROM" Postgresql

2005-02-25 Thread Eduardo Vázquez Rodríguez
Hello Does anybody has already programmed the way of using the "COPY FROM" function from postgres, I try producing the following code: my ($dbh, $sth10); $dbh = DBI->connect("dbi:Pg:dbname=$database", "$username", "$password") or die "Error: $DBI::errstr \n"; $sth10 = $dbh->prepa

Re: Perl error --> Global symbol requires...

2005-02-25 Thread John W. Krahn
Bret Goodfellow wrote: I'm getting the following error in my code. If I define $i as my $i then everything works fine. What's wrong? perldoc -q "When I tried to run my script, I got this message. What does it mean" # while1.pl use strict ; use warnings ; $i = 1; while ($i < 10) { print "I

Re: redefining Net::Telnet "escape" character

2005-02-25 Thread Joe Mecklin
i'll try it when i get back to work, though i don't see how binmode will tell me what net::telnet command i need to use to redefine a character sequence, or what external command i'll need to call to accomplish that. thanks for the suggestion, though. On Fri, 25 Feb 2005 12:13:41 -0500, [EMAIL

Send file to printer

2005-02-25 Thread Brian Volk
Hi All, I have been searching Google for a while now and I can not find how to send a file to the printer. For example I use the script below to get Material Safety Data Sheets and store them in a directory ..where I can easily print them out manually but what I would really like to do is send t

Perl error --> Global symbol requires...

2005-02-25 Thread Bret Goodfellow
I'm getting the following error in my code. If I define $i as my $i then everything works fine. What's wrong? # while1.pl use strict ; use warnings ; $i = 1; while ($i < 10) { print "I am at $i\n"; i++; } # while1.pl Global symbol "$i" requires explicit package name at C:\BegPerl\wh

Re: Testing question

2005-02-25 Thread Chris Devers
On Thu, 24 Feb 2005, Robert wrote: > I am trying to wrap my head around testing. What exactly do you test? > I do mostly scripts for admin stuff and not modules. My scripts do > things like run a program and then email the generated log file to me. > Would you test that? What fits the criteria

Re: calling an invocation argument from @ARGV

2005-02-25 Thread John W. Krahn
Christopher Spears wrote: I'm trying to automate g++ through a Perl script. Here is what I have written so far: #!/bin/perl -w use strict; my $counter; $counter = 0; for (my $i = 0; $i < @ARGV; $i++) { $counter++; } You don't need a loop for that as an array in scalar context returns the numb

Re: Appending in between some file

2005-02-25 Thread John W. Krahn
Anish Kumar K. wrote: Hi Hello, I wanted to append some line in between a text file. So what I tried is with the seek command I tried moving the pointer and then do appeding, but for some reason it was not getting appended. I know there are ways to make this task possible. I am afraid abot the

Re: pattern matching

2005-02-25 Thread John W. Krahn
Aaron Reist wrote: Hello everyone, Hello, not quite sure if what I m trying to do is possible, but here is the basic idea: Currently I have a simple program takes a username from a html textbox and checks against a list of values in a notepad document. If the name is found the user is given ac

Re: Testing question

2005-02-25 Thread John W. Krahn
Robert wrote: I am trying to wrap my head around testing. What exactly do you test? I do mostly scripts for admin stuff and not modules. My scripts do things like run a program and then email the generated log file to me. Would you test that? What fits the criteria for "it needs a test"? Test ev

Re: lwp-download

2005-02-25 Thread Todd W
"Benjamin Jeeves" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > I have now used the code below to download the CSV file which it does but the > rest of the script does not get executed e.g. to open the file and read the > data and place it in to it databases are ideas why? >

RE: calling an invocation argument from @ARGV

2005-02-25 Thread Larsen, Errin M HMMA/IT
<> > > #!/bin/perl -w > > use strict; > > ## you should: > use warnings; > ## it will help you in the future > <> Oops! I just realized your using that '-w' switch to perl up there. That IS using the warnings pragma, I believe. Sorry about that! --Errin -- To unsubscribe, e-ma

RE: calling an invocation argument from @ARGV

2005-02-25 Thread Larsen, Errin M HMMA/IT
Hi! And, welcome to Perl! > > I'm trying to automate g++ through a Perl script. > Here is what I have written so far: > > #!/bin/perl -w > use strict; ## you should: use warnings; ## it will help you in the future > > my $counter; > $counter = 0; ## With Perl, it's not really

calling an invocation argument from @ARGV

2005-02-25 Thread Christopher Spears
I'm trying to automate g++ through a Perl script. Here is what I have written so far: #!/bin/perl -w use strict; my $counter; $counter = 0; for (my $i = 0; $i < @ARGV; $i++) { $counter++; } if ($counter == 0) { print "Not enough arguments!"; print "Usage: ./cedit somefile.C++";

Re: redefining Net::Telnet "escape" character

2005-02-25 Thread mgoland
Joe, Try turning binmod on. If it fails post some code and a bit more od a description of what you are trying to do. hth, Mark G. - Original Message - From: Joe Mecklin <[EMAIL PROTECTED]> Date: Friday, February 25, 2005 8:44 am Subject: redefining Net::Telnet "escape" character > i

Read config variables in instalation script

2005-02-25 Thread Santiago Hirschfeld
Hi everyone, I'm trying to make an installer for my program and was planning on using ExtUtils::MakeMaker, but don't know how to read the value set in PREFIX when the user does: perl Makefile.PL PREFIX=/foo/bar How can i read this value in the main program? to reffer some paths to that. Than

Re: lwp-download

2005-02-25 Thread Benjamin Jeeves
It is ok now I have it working thank you Ben On Friday 25 February 2005 15:24, Charles K. Clarkson wrote: > Benjamin Jeeves <[EMAIL PROTECTED]> wrote: > : I have a perl program that I have developed that stores some > : numbers in a mysql databases. But I need to make the script go > : to a web si

Re: lwp-download

2005-02-25 Thread Benjamin Jeeves
Hi I have now used the code below to download the CSV file which it does but the rest of the script does not get executed e.g. to open the file and read the data and place it in to it databases are ideas why? use LWP::Simple; $url = "web-server here"; $file = "/home/filename.csv"; $content =

RE: lwp-download

2005-02-25 Thread Charles K. Clarkson
Benjamin Jeeves <[EMAIL PROTECTED]> wrote: : I have a perl program that I have developed that stores some : numbers in a mysql databases. But I need to make the script go : to a web site download a CSV file and the process the data in : that file. I have try lwp-download by using : system("lwp-dow

RE: Calling Files automatically

2005-02-25 Thread Charles K. Clarkson
Edward Wijaya <[EMAIL PROTECTED]> wrote: : How can I modify the early part of code below such that : I don't have to manually key in the files this way: : : perl mycode.pl data1P.fa data1R.fa data2P.fa data2R.fa : etc : : [snip] : : NOTE: : The code above take pair-series of files as follows

Re: Calling Files automatically

2005-02-25 Thread Wiggins d'Anconia
Edward Wijaya wrote: Hi, How can I modify the early part of code below such that I don't have to manually key in the files this way: perl mycode.pl data1P.fa data1R.fa data2P.fa data2R.fa etc I.e. just by typing this will do: perl mycode.pl Thanks so much for your time beforehand. Based on the

lwp-download

2005-02-25 Thread Benjamin Jeeves
Hi all I have a perl program that I have developed that stores some numbers in a mysql databases. But I need to make the script go to a web site download a CSV file and the process the data in that file. I have try lwp-download by using system("lwp-download the URL"); but once it has download t

Calling Files automatically

2005-02-25 Thread Edward Wijaya
Hi, How can I modify the early part of code below such that I don't have to manually key in the files this way: perl mycode.pl data1P.fa data1R.fa data2P.fa data2R.fa etc I.e. just by typing this will do: perl mycode.pl Thanks so much for your time beforehand. -- Edward WIJAYA Singapore __BEGIN

Re: Reading and writing to a program

2005-02-25 Thread marcos rebelo
the problem is not the My. The program prints: print 0 print 1 print 2 print 3 and stops this is the problem I was hopping to get print 0 print 1 print 2 print 3 1 2 3 thanks Marcos On Fri, 25 Feb 2005 08:26:03 -0500 (EST), Chris Devers <[EMAIL PROTECTED]> wrote: > On Fri, 25 Feb 2005, Mar

redefining Net::Telnet "escape" character

2005-02-25 Thread Joe Mecklin
i sent this to the comp.lang.perl.modules newsgroup as the documentation suggests and got no response at all, so i thought i'd see if anyone here may be able to help. i'm using net::telnet to connect to a remote script (rather than a login). the script internally uses "^]" to step back through it

Re: Reading and writing to a program

2005-02-25 Thread Chris Devers
On Fri, 25 Feb 2005, Marcos Rebelo wrote: > My $pid = open2(my $RDRFH, my $WTRFH, "perl", "-e", "while (<>) > {print}"); Using 'use warnings' should have told you that 'My' is broken here. What messages do you get when you try to run the program? -- Chris Devers -- To unsubscribe, e-mail

Reading and writing to a program

2005-02-25 Thread Marcos Rebelo
I need to do some commands in another machine, I will try something like 'rlogin machine'. I'm not allowed to install new packages in the machine :'( To simplifey I tried to run a simple command in perl to simulate a 'more' command. use IPC::Open2; use IO::Handle '_IOLBF'; My $pid = open2(my $

RE: Appending in between some file

2005-02-25 Thread Thomas Bätzler
Anish Kumar K. <[EMAIL PROTECTED]> asked: > I wanted to append some line in between a text file. So what > I tried is with the seek command I tried moving the pointer > and then do appeding, but for some reason it was not getting > appended. When you seek() and write in the middle of a file, it