[15459] in Perl-Users-Digest
Perl-Users Digest, Issue: 2869 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 26 14:07:33 2000
Date: Wed, 26 Apr 2000 11:05:21 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956772321-v9-i2869@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 26 Apr 2000 Volume: 9 Number: 2869
Today's topics:
[REGEXP] Extremely important please read! <charles.henry@engineer2k.com>
Re: [REGEXP] Extremely important please read! <lauren_smith13@hotmail.com>
Re: [REGEXP] Extremely important please read! nobull@mail.com
Re: [REGEXP] Extremely important please read! <lr@hpl.hp.com>
Re: [REGEXP] Extremely important please read! <lr@hpl.hp.com>
Re: \ in @ARGV <rhomberg@ife.ee.ethz.ch>
Re: \ in @ARGV <lr@hpl.hp.com>
Re: Accessing Perl 5 on NT <rootbeer@redcat.com>
Re: calling a cgi <sid@eurekanet.com>
Can't get 'require' to work 4189058@my-deja.com
Re: Can't get 'require' to work <jeff@vpservices.com>
Re: Can't get 'require' to work <red_orc@my-deja.com>
Re: clearning contents of a hash <uri@sysarch.com>
closing cursors with DBD::Oracle mchavel@my-deja.com
Re: DBD::Sybase and/or freeTDS oddities <mpeppler@peppler.org>
Re: Extracting part of a string (Tad McClellan)
Re: files redirection to an external program <rhomberg@ife.ee.ethz.ch>
Re: GD: Problem in installing GD 1.20-1.27 (Elaine -HFB- Ashton)
Re: How to install perl on win98 <sid@eurekanet.com>
inserting $line into the middle of a list... <kmojar@bmjgroup.com>
Re: inserting $line into the middle of a list... <lauren_smith13@hotmail.com>
Re: match and assign statement nobull@mail.com
Re: Net:FTP module not working for me on perl win32... <somewhere@planet.earth>
Re: Net:FTP module not working for me on perl win32... <gerard@NOSPAMlanois.com>
Re: NEWBIE: Testing scripts (Tad McClellan)
Re: NEWBIE: Testing scripts nobull@mail.com
Perl 5.6.0/Solaris: ok to compile with [but not use] 5. <eryq@zeegee.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Apr 2000 18:41:30 +0100
From: "Charles Henry" <charles.henry@engineer2k.com>
Subject: [REGEXP] Extremely important please read!
Message-Id: <8e76ie$l30$1@reader1.fr.uu.net>
I am trying to extract the domain name off a url using Perl's implementation
of RegEp.
Here is what I did :
$url =~s!http://([^/]+).*!$1!;
$url =~m!([^\.]+\.[^\.]+)$!;
It just works but it's not very clever obviously.
Does anyone know how to do that effectively?
For example the regep should extract the string "domain.com" off the
following patterns :
http://www.domain.com
http://www.domain.com/
http://www.domain.com/abc
http://www.domain.com/a/abc.html
http://a.b.c.www.domain.com
http://a.b.c.www.domain.com/
http://a.b.c.www.domain.com/abc
etc...
Thanks for any help you can provide.
It is very important for my project guys!!!
--
Charles Henry.
------------------------------
Date: Wed, 26 Apr 2000 10:15:10 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: [REGEXP] Extremely important please read!
Message-Id: <8e787o$hp8$1@brokaw.wa.com>
> Re: [REGEXP] Extremely important please read!
Well, that's not a very helpful title, now is it?
Charles Henry <charles.henry@engineer2k.com> wrote in message
news:8e76ie$l30$1@reader1.fr.uu.net...
>
> Here is what I did :
>
> For example the regep should extract the string "domain.com" off the
> following patterns :
>
> $url =~s!http://([^/]+).*!$1!;
> $url =~m!([^\.]+\.[^\.]+)$!;
>
>
> http://www.domain.com
> http://www.domain.com/
> http://www.domain.com/abc
> http://www.domain.com/a/abc.html
> http://a.b.c.www.domain.com
> http://a.b.c.www.domain.com/
> http://a.b.c.www.domain.com/abc
$domain = $1 if ($url =~ /\.([^.]*.\.com)/);
Lauren
------------------------------
Date: 26 Apr 2000 18:13:20 +0100
From: nobull@mail.com
Subject: Re: [REGEXP] Extremely important please read!
Message-Id: <u9zoqgrdjj.fsf@wcl-l.bham.ac.uk>
"Charles Henry" <charles.henry@engineer2k.com> writes:
> Subject: Re: [REGEXP] Extremely important please read!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> For example the regep should extract the string "domain.com" off the
> following patterns :
>
> http://www.domain.com
> http://www.domain.com/
> http://www.domain.com/abc
> http://www.domain.com/a/abc.html
> http://a.b.c.www.domain.com
> http://a.b.c.www.domain.com/
> http://a.b.c.www.domain.com/abc
Do you always want a second level domain? (Why do you (think that)
want this?)
$domain = ( $url =~ m!^http://.*?([^.]+\.[^.]+)/! )[0];
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 26 Apr 2000 10:44:28 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: [REGEXP] Extremely important please read!
Message-Id: <MPG.1370cadaf44c54a098a987@nntp.hpl.hp.com>
In article <8e76ie$l30$1@reader1.fr.uu.net> on Wed, 26 Apr 2000 18:41:30
+0100, Charles Henry <charles.henry@engineer2k.com> says...
> I am trying to extract the domain name off a url using Perl's implementation
> of RegEp.
>
> Here is what I did :
>
> $url =~s!http://([^/]+).*!$1!;
> $url =~m!([^\.]+\.[^\.]+)$!;
>
> It just works but it's not very clever obviously.
>
> Does anyone know how to do that effectively?
>
> For example the regep should extract the string "domain.com" off the
> following patterns :
<List inserted into one-liner program below.>
#!/usr/bin/perl -w
use strict;
m!([^./]+\.[^./]+)(?:/|$)! and print "$1\n" for qw(
http://www.domain.com
http://www.domain.com/
http://www.domain.com/abc
http://www.domain.com/a/abc.html
http://a.b.c.www.domain.com
http://a.b.c.www.domain.com/
http://a.b.c.www.domain.com/abc
);
> Thanks for any help you can provide.
> It is very important for my project guys!!!
You have a strange view of what gets people's help from Usenet. A
subject that pleads importance to you doesn't change a thing.
Everything is important to the person who submits it.
Capital letters don't help either. In fact, had you no lower-case
letters, some people's software would have filtered your post away
automatically.
But I answered you anyway, despite the provocation. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 11:00:04 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: [REGEXP] Extremely important please read!
Message-Id: <MPG.1370ce7ddebf90c798a988@nntp.hpl.hp.com>
In article <u9zoqgrdjj.fsf@wcl-l.bham.ac.uk> on 26 Apr 2000 18:13:20
+0100, nobull@mail.com <nobull@mail.com> says...
> "Charles Henry" <charles.henry@engineer2k.com> writes:
...
> > For example the regep should extract the string "domain.com" off the
> > following patterns :
> >
> > http://www.domain.com
> > http://www.domain.com/
> > http://www.domain.com/abc
> > http://www.domain.com/a/abc.html
> > http://a.b.c.www.domain.com
> > http://a.b.c.www.domain.com/
> > http://a.b.c.www.domain.com/abc
> $domain = ( $url =~ m!^http://.*?([^.]+\.[^.]+)/! )[0];
That is a baroque way to make a simple capture.
($domain) = $url =~ m!^http://.*?([^.]+\.[^.]+)/!;
But it doesn't work on all the sample data anyway. Two of them don't
have a slash to match on, and one matches beyond where it should.
I doubt that you tried it before posting, which is Hubris of the least
acceptable kind.
Failed to match 'http://www.domain.com'
domain.com
domain.com
domain.com/a
Failed to match 'http://a.b.c.www.domain.com'
domain.com
domain.com
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 17:12:15 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: \ in @ARGV
Message-Id: <3907074F.5782AB5B@ife.ee.ethz.ch>
Anthony Argyriou wrote:
>
> How can I preserve a '\' in a command line?
The program generates a call of
> "program.exe c:\path\to\file".
Try forward slashes instead of backwhacks. Windows should be able to
handle them.
- Alex
------------------------------
Date: Wed, 26 Apr 2000 09:38:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: \ in @ARGV
Message-Id: <MPG.1370bb71cdb4732998a984@nntp.hpl.hp.com>
In article <3907074F.5782AB5B@ife.ee.ethz.ch> on Wed, 26 Apr 2000
17:12:15 +0200, Alex Rhomberg <rhomberg@ife.ee.ethz.ch> says...
> Anthony Argyriou wrote:
> >
> > How can I preserve a '\' in a command line?
>
> The program generates a call of
> > "program.exe c:\path\to\file".
>
> Try forward slashes instead of backwhacks. Windows should be able to
> handle them.
The command processor needs to have backslashes, because forward slashes
are treated as option introducers. Sigh.
The problem may be that because of the double quotes, there are no
backslashes in the string shown.
"program.exe c:\\path\\to\\file"
Or, better:
'program.exe c:\path\to\file'
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 10:21:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Accessing Perl 5 on NT
Message-Id: <Pine.GSO.4.10.10004261020430.25963-100000@user2.teleport.com>
On Wed, 26 Apr 2000, eva wrote:
> We have Perl 5 installed on our server, NT4 running IIS4 with SP6a.
> My question is what is the best way to allow my domain users access to
> that location? We host domains that wish to run Perl scripts.
I could be mistaken, but it sounds as if you're wanting to learn how to
configure a webserver. Perhaps you should search for the docs, FAQs, and
newsgroups about webservers in general and yours in particular. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 26 Apr 2000 11:56:34 -0500
From: Sid Mal <sid@eurekanet.com>
Subject: Re: calling a cgi
Message-Id: <390711bd$0$11783@news.eurekanet.com>
You could also try redirecting the browser.
print "Location: http://www.domain.com/script.cgi?one=$in{'one'}\n\n";
make sure this is the first line you output.
Sid.
morlou@my-deja.com wrote:
>
> I'd like to know how to call a Perl cgi script from a Perl cgi script
> and pass a parameter.
>
> Exactly, I have an HTML form which has a POST action calling xxx.cgi,
> then in xxx.cgi I'd like to call yyy.cgi with a parameter which is the
> content of the buffer (Content of the HTML form). This way, yyy.cgi
> could process the information that is coming from the form... Somebody
> knows how to do it??? Please help me! Thanks!
>
> Louis Morin
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 17:14:16 GMT
From: 4189058@my-deja.com
Subject: Can't get 'require' to work
Message-Id: <8e784l$ena$1@nnrp1.deja.com>
I'm using perl version 5.005_03 for MS Win32 and I'm having a problem
including an external file in a cgi script. The include file path is
a:\include.pl and the cgi script path is a:\test.cgi. The test.cgi
script has the line:
require ('a:\include.pl');
When I run the script I get a message saying the line with the require
statement did not return a true value. Any help would be appreciated.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 10:32:38 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Can't get 'require' to work
Message-Id: <39072836.8D965CBB@vpservices.com>
4189058@my-deja.com wrote:
>
> When I run the script I get a message saying the line with the require
> statement did not return a true value. Any help would be appreciated.
Read the documentation on require. Notice that it says that your
required file must return a true value. Usually this means that you
should put something that evaluates to true as the last line in the
required file.
So just add something like this to your "include.pl" file at the very
end of the file:
1; # this always evaluates to true
Or if you want to be cute:
"false"; # this always evaluates to true
--
Jeff
------------------------------
Date: Wed, 26 Apr 2000 17:28:05 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Can't get 'require' to work
Message-Id: <8e78uc$fvi$1@nnrp1.deja.com>
In article <8e784l$ena$1@nnrp1.deja.com>,
4189058@my-deja.com wrote:
> I'm using perl version 5.005_03 for MS Win32 and I'm having a problem
> including an external file in a cgi script. The include file path is
> a:\include.pl and the cgi script path is a:\test.cgi. The test.cgi
> script has the line:
> require ('a:\include.pl');
> When I run the script I get a message saying the line with the require
> statement did not return a true value. Any help would be appreciated.
>
perldoc -f require:
The ('require'd) file must return TRUE as the last statement to indicate
successful execution of any initialization code, so it's customary to
end such a file with "1;" unless you're sure it will return TRUE
otherwise.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 16:50:53 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: clearning contents of a hash
Message-Id: <x7bt2w4xhv.fsf@home.sysarch.com>
>>>>> "A" == <anon@nic.harvard.edu> writes:
>> On Fri, 21 Apr 2000 15:42:37 +0000 James Philip Ryan wrote:
>> > i need to remove all elements of a hashtable or hashtables, is there a
>> > way i can remove the root hashtable from memory entirely?
A> There's always--
A> undef %hash;
a poor choice. assigning () is much simpler and cleaner. my biggest beef
with undefining aggregates is that it leads newbies to using defined to
see if the aggregates have any values and that is totally wrong.
so teach %hash = () and you won't have to correct defined( %hash) as
often.
in fact the docs should be changed to reflect this instead of showing
how to use undef as above. i think it should only be used to assign
undef values and rarely as a function to undefine a var.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 26 Apr 2000 15:55:38 GMT
From: mchavel@my-deja.com
Subject: closing cursors with DBD::Oracle
Message-Id: <8e73hf$9b1$1@nnrp1.deja.com>
using the DBD::Oracle module
i can use $sth->bind_param_inout
to return a cursor from a PL/SQL procedure
and fetch from it.
but how do i close the cursor?
i am running out of open cursors fast!
here is my code:
sub execute_function {
my ($func_name, @params_in) = @_;
my ($params, $sth, $curh);
for (0..$#params_in) {
$params .= ":in$_, ";
}
$params = substr($params, 0, -2);
$sth = $dbh->prepare(qq{
BEGIN :curout := $func_name($params); END;
}) or warn($dbh->errstr);
$sth->bind_param_inout(":curout", \$curh, 1,
{ ora_type => ORA_RSET } );
for (0..$#params_in) {
$sth->bind_param(":in$_", $params_in[$_]);
}
$sth->execute() or warn($dbh->errstr);
$sth->finish;
DBI::dump_results($curh);
$curh->finish;
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 08:47:15 -0700
From: Michael Peppler <mpeppler@peppler.org>
Subject: Re: DBD::Sybase and/or freeTDS oddities
Message-Id: <39070F83.D2142785@peppler.org>
Jay Flaherty wrote:
>
> Tom Phoenix <rootbeer@redcat.com> wrote in message
> news:Pine.GSO.4.10.10004230811370.25963-100000@user2.teleport.com...
> >
> > > I find it hard to believe that nobody is using the freeTDS driver with
> > > the Sybase.pm module to access MS SQLServer from a Sun box running
> > > Solaris 2.8.
> >
> > That's pretty specific. Are you sure your problem comes up only in that
> > configuration?
>
> No, I'm not sure. I only have access to the above system and a PC running
> RedHat 6.2. It works beautifully under linux and works with a lot of
> indiosyncrasies under solaris. Biggest problem is it hangs on queries
> returning only one row. It thinks there is more rows and waits. It also
> seems to destroy the array I store the row in when I use
> $sth->{syb_more_results} to get past the waiting.
The problems are almost certainly related to freetds, not to DBD::Sybase
(although I admit to not having tried DBD::Sybase under Solaris 2.8).
So have you tried the freetds mailing list? (http://www.freetds.org for
details).
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
------------------------------
Date: Wed, 26 Apr 2000 12:45:34 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Extracting part of a string
Message-Id: <slrn8ge79e.84i.tadmc@magna.metronet.com>
On Wed, 19 Apr 2000 00:06:55 -0500, Dan Olson <theoddone@quakefiles.com> wrote:
>Tony Curtis wrote:
>>
>> >> On Wed, 19 Apr 2000 02:17:53 GMT,
>> >> "Daniel Murphy" <danmurph@worldnet.att.net> said:
>>
>> > I would like to assign just the last several characters
>> > of a string to a text variable. The characters I want to
>> > save occur after a certain letter, which is always the
>> > same. I Bourne shell, I can use "cut", using that
>> > certain letter as a delimiter, but I don't know of a
>> > convenient substitute in Perl.
>>
>> perldoc perlre
>> perldoc -f substr
>I had a similar problem. I added these two lines into my perl program,
>but they only generated errors. What am I doing wrong?
You are supposed to type them on the command line, not
insert them in a program.
They are the colloquial way of saying:
"read the regular expression man page" (perlre)
and
"read about the substr() function"
To learn how to use perldoc to look up things in the standard
documentation that is already installed on your hard disk, type:
perldoc perldoc
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Apr 2000 17:30:11 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: files redirection to an external program
Message-Id: <39070B83.74C0DE18@ife.ee.ethz.ch>
Logean Antoine wrote:
> % input.txt > XXX
Read the manpage of your shell. This tries to execute input.txt and
redirects the output into XXX. In short, it can't work. And you know
that since you tested it before posting here.
> #!/usr/sbin/perl -w
-w: good. add
use strict;
my $num = 17;
> $num = 17;
> $input = "complex" . $num . ".topol\n";
Do interpolation and 'here' data
> open TRANS, "| pamb" or die "can not open the pipe : $!";
Testing the status of open and close: good
> print TRANS <<EOT
complex$num.topol
1
complex$num.mincrd
1
comples$num.min.pdb
EOT
> close TRANS or die "can not close the pipe : $!";
> Can't exec "pamb": Permission denied at concane.pl line 9.
What is so difficult about this? You don't have the permission to call
that program, for some reason. Make sure that you can run the program
with the same user ID as the script will run later. Use absolute paths
to avoid path problems.
There was no Perl question in your post.
> system("$input > pamb");
This obviously bullshit as noted above. It even gives you precise error
messages.
- Alex
------------------------------
Date: 26 Apr 2000 16:07:27 GMT
From: elaine@chaos.wustl.edu (Elaine -HFB- Ashton)
Subject: Re: GD: Problem in installing GD 1.20-1.27
Message-Id: <slrn8ge50o.re8.elaine@chaos.wustl.edu>
In article <20000426055141.13019.00000482@ng-ch1.aol.com>, Stearns25 wrote:
>hello all,
>
>I need some help in installing the GD.pm package in my RH 6.0 box. Perl 5.005
>is already fully installed and functional. We need GD in order to use the
>Barcode module.
I've not seen that particular error but RH doesn't give me a lot of confidence
that everything is kosher on the system...
http://search.cpan.org/doc/LDS/GD-1.27/README.unix and
http://search.cpan.org/doc/LDS/GD-1.27/README
might give you a few options, namely rebuilding Perl and trying GD with
fresh versions of GD-1.8.1 and GD.pm 1.27.
Good luck.
e.
------------------------------
Date: Wed, 26 Apr 2000 11:43:16 -0500
From: Sid Mal <sid@eurekanet.com>
Subject: Re: How to install perl on win98
Message-Id: <39070e9f$0$11758@news.eurekanet.com>
To get ActivePerl and lots of installation and running support visit
http://www.activestate.com
Sid.
Matt King wrote:
>
> Download the Active Perl version for Win32. Works just fine on Windows
> 95/98/NT/2000. (Yes, I tried this on all these OS's)
>
> Matt
------------------------------
Date: Wed, 26 Apr 2000 18:05:26 +0100
From: Kourosh A Mojar <kmojar@bmjgroup.com>
Subject: inserting $line into the middle of a list...
Message-Id: <390721D6.56668298@bmjgroup.com>
Dear all,
I am a novice perl programmer. I have a few scripts that read in and
modify text files (SGML). In this particular script I want to insert all
lines from a second file into the middle of the original file. My script
works by reading in each line from original file into a list (@lines).
foreach $line (@lines) {
foreach ($line =~ "</TABLEDATA>") {
open (TABLE_IN, $TABLEFILE) || die "Can't open $TABLEFILE.";
@table_lines = <TABLE_IN>; # slurp file into array
close (TABLE_IN); # close file now all lines in list
foreach $table_line (@table_lines) {
#?! insert $table_line into @lines list #?!
}
I know that "push (@lines, $table_line);" adds the $table_line's at the
end of the array but don't know how to insert in the middle while the
loop is looking at the "$line =~ "</TABLEDATA>"".
If anyone can understand my problem and might be able to help me I would
appreciate it ever so much. Thanking you in advance and for your kind
attention.
Kourosh A Mojar
kmojar@bmjgroup.com
------------------------------
Date: Wed, 26 Apr 2000 10:21:15 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: inserting $line into the middle of a list...
Message-Id: <8e78j2$gqn$1@brokaw.wa.com>
Kourosh A Mojar <kmojar@bmjgroup.com> wrote in message
news:390721D6.56668298@bmjgroup.com...
> Dear all,
>
> I am a novice perl programmer. I have a few scripts that read in and
> modify text files (SGML). In this particular script I want to insert all
> lines from a second file into the middle of the original file. My script
> works by reading in each line from original file into a list (@lines).
>
> foreach $line (@lines) {
> foreach ($line =~ "</TABLEDATA>") {
> open (TABLE_IN, $TABLEFILE) || die "Can't open $TABLEFILE.";
A tip, put '$!' into the 'die' output. It will give you the explicit reason
the 'open' failed.
> @table_lines = <TABLE_IN>; # slurp file into array
> close (TABLE_IN); # close file now all lines in list
> foreach $table_line (@table_lines) {
> #?! insert $table_line into @lines list #?!
> }
>
> I know that "push (@lines, $table_line);" adds the $table_line's at the
> end of the array but don't know how to insert in the middle while the
> loop is looking at the "$line =~ "</TABLEDATA>"".
>
> If anyone can understand my problem and might be able to help me I would
> appreciate it ever so much. Thanking you in advance and for your kind
> attention.
I think you're looking for
perldoc -f splice
Lauren
------------------------------
Date: 26 Apr 2000 18:06:54 +0100
From: nobull@mail.com
Subject: Re: match and assign statement
Message-Id: <u91z3sssep.fsf@wcl-l.bham.ac.uk>
denance@my-deja.com writes:
> Subject: match and assign statement
=~ is _not_ an assignment operator.
> Can someone please confirm/correct my interpretation of the rvlaue of
> the following statment:
The thing on the RHS of =~ is not an rvalue, it's a operator that
would usually default to acting on $_.
> $ob=~/PA:"?([^"><,]+)"?,/
>
> PA: followed by an optional " followed by anything but one or more of
> the following characters: ^ " > < or , followed by an optional "
> followed by a ,
No.
PA: followed by an optional " followed by one or more of any character
except: " > < or , followed by an optional " followed by a ,
Note: $1 is set to the bit of $ob that matched the bit of the pattern
that is in parentheses.
Note also: the expression is unanchored so PA: do not need to be the
first characters in $ob and , does not need to be the last.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 26 Apr 2000 16:45:16 +0200
From: "Dimitri Gunsing" <somewhere@planet.earth>
Subject: Re: Net:FTP module not working for me on perl win32...
Message-Id: <8e6vdh$a39$1@list.pbnec.nl>
Have you tried installing the libnet module from www.activestate.com (the
one for WIN32)?
Kourosh A Mojar <kmojar@bmjgroup.com> wrote in message
news:3906F24F.A6727BB7@bmjgroup.com...
> Dear all,
>
> I am an fairly experienced novice user of perl. I am using perl win32
> (ActivePerl 633) on win nt4 srvpck 5. Previously I used ftp oriented
> scripts to automate some file transfers (while I was using cross
> platform perl). Now I have upgraded/changed to perl win32 this no longer
> works. I have installed (I hope I set everything correctly) and updated
> the the latest libnet module (using ppm.bat) which includes the ftp
> Net::FTP module. Since I changed I cant use the FTP modules. I get this
> syntax error:
>
> syntax error at C:/Perl/site/lib/Net/Config.pm line 86, near ">"
> Compilation failed in require at C:/Perl/site/lib/Net/FTP.pm line 21.
> BEGIN failed--compilation aborted at C:/Perl/site/lib/Net/FTP.pm line
> 21.
> Compilation failed in require at D:\ce\is3_prnt\support\copy_ftptest.pl
> line 3.
> BEGIN failed--compilation aborted at
> D:\ce\is3_prnt\support\copy_ftptest.pl line 3.
>
> I have looked at the modules but I don't think I can decide or
> understand where I am going wrong.
>
> Can any one help me? Thanking you in advance and for your kind
> attention,
>
> Kourosh A Mojar
> kmojar@bmjgroup.com
------------------------------
Date: Wed, 26 Apr 2000 09:38:05 -0700
From: Gerard Lanois <gerard@NOSPAMlanois.com>
Subject: Re: Net:FTP module not working for me on perl win32...
Message-Id: <39071B6D.38B00D6@NOSPAMlanois.com>
Please post the last 20 or so lines of your Config.pm.
There is a hash called %NetConfig, which consists of entries
you typed in when you installed libnet. It should look
something like this:
---snip---
# Below this line is auto-generated, *ANY* changes will be lost
%NetConfig = (
test_hosts => '0',
nntp_hosts => ['newshost'],
snpp_hosts => [],
pop3_hosts => ['mailhost'],
ftp_ext_passive => '0',
smtp_hosts => ['nnn.nnn.nnn.nnn'],
inet_domain => 'somwhere.com',
ph_hosts => [],
test_exist => '1',
daytime_hosts => [],
ftp_int_passive => '0',
ftp_firewall => undef,
time_hosts => [],
);
1;
---snip---
You might try re-installing libnet manually; get the .tar.gz from CPAN,
unpack it, perl Makefile.PL, nmake, nmake install.
If you don't already have nmake on your system, you can get it for
free from Microsoft (really!) at
ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
The installation for libnet asks you a bunch of questions, intending
to fill in the %NetConfig above. Perhaps there was some interference
or confusion between the PPM prompt and the libnet installer prompting
you?
The ">" is usually something that happens when somebody cuts and
pastes Perl code from an HTML file into a Perl program. I'm not sure
why you're getting that particular error from Config.pm. I'd have
to see the bottom of your Config.pm file to be sure.
-Gerard
http://www.lanois.com/perl/
Kourosh A Mojar wrote:
>
> Dear all,
>
> I am an fairly experienced novice user of perl. I am using perl win32
> (ActivePerl 633) on win nt4 srvpck 5. Previously I used ftp oriented
> scripts to automate some file transfers (while I was using cross
> platform perl). Now I have upgraded/changed to perl win32 this no longer
> works. I have installed (I hope I set everything correctly) and updated
> the the latest libnet module (using ppm.bat) which includes the ftp
> Net::FTP module. Since I changed I cant use the FTP modules. I get this
> syntax error:
>
> syntax error at C:/Perl/site/lib/Net/Config.pm line 86, near ">"
> Compilation failed in require at C:/Perl/site/lib/Net/FTP.pm line 21.
> BEGIN failed--compilation aborted at C:/Perl/site/lib/Net/FTP.pm line
> 21.
> Compilation failed in require at D:\ce\is3_prnt\support\copy_ftptest.pl
> line 3.
> BEGIN failed--compilation aborted at
> D:\ce\is3_prnt\support\copy_ftptest.pl line 3.
>
> I have looked at the modules but I don't think I can decide or
> understand where I am going wrong.
>
> Can any one help me? Thanking you in advance and for your kind
> attention,
>
> Kourosh A Mojar
> kmojar@bmjgroup.com
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 26 Apr 2000 09:59:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: NEWBIE: Testing scripts
Message-Id: <slrn8gdti9.7qq.tadmc@magna.metronet.com>
On Wed, 26 Apr 2000 16:04:46 +0200, Ola Jetlund <jetlund@tele.ntnu.no> wrote:
>I'm trying to test a script. The scripts work when I test it from the promt:
>
> perl test.pl
>
>But I can't seem find out how to test it with netscape.
Perl FAQ, part 9:
"My CGI script runs from the command line but not the browser."
Your question is not a Perl question (since it works from the
command line).
Your question is a CGI (or WWW server) question.
You should ask in a WWW related newsgroup, such as:
comp.infosystems.www.authoring.cgi
comp.infosystems.www.servers.mac
comp.infosystems.www.servers.misc
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.servers.unix
Short answer: You need a _server_ to run CGI programs. Install a server.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Apr 2000 18:01:19 +0100
From: nobull@mail.com
Subject: Re: NEWBIE: Testing scripts
Message-Id: <u966t4sso0.fsf@wcl-l.bham.ac.uk>
Ola Jetlund <jetlund@tele.ntnu.no> writes:
> I'm trying to test a script. The scripts work when I test it from the promt:
>
> perl test.pl
>
> But I can't seem find out how to test it with netscape. When I write the
>
> scripts location on my harddisk netscape wants to download it.
To test a CGI script you need to put in on a webserver that supports
GCI scripts. This has nothing to do with Perl. There are many freely
available web servers for just about any platform you care to
mention. Get one.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 26 Apr 2000 12:31:57 -0400
From: Eryq <eryq@zeegee.com>
Subject: Perl 5.6.0/Solaris: ok to compile with [but not use] 5.005 threads?
Message-Id: <390719FD.4F196AC4@zeegee.com>
I'm running Perl 5.6.0 on Solaris, which I've built with 5.005-style
thread support. I know that we're not supposed to deploy such a
Perl in a production environment, but I'd like a little clarification:
Suppose that none of my production scripts *use* threads; I just
want the Thread support in there for a few non-production scripts.
Will this setup be okay, or does compiling with 5.005 support
somehow comprimise unrelated parts of Perl?
TIA,
Eryq
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 2869
**************************************