[13448] in Perl-Users-Digest
Perl-Users Digest, Issue: 858 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 20 17:07:26 1999
Date: Mon, 20 Sep 1999 14:05:14 -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: <937861513-v9-i858@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 20 Sep 1999 Volume: 9 Number: 858
Today's topics:
Языки программирования, технология разработки ПО и мног <zal@rest.ru>
Re: Anomymous Hash <aqumsieh@matrox.com>
Configuring @INC for a movable Perl dist. <cmontgomery@campuspipeline.com>
Re: Constructing a next/more feature for a list display <ICEMOUNTAIN@prodigy.net>
Re: CONTEST: Range Searching (Yitzchak Scott-Thoennes)
Converting Perl pages from ODBC to OLE <jakoye@my-deja.com>
Re: Help me to make it work...please <aqumsieh@matrox.com>
How to password a file? <ysroh@chat.carleton.ca>
Re: How to password a file? (Abigail)
how to put each line of file to a variable? <tom.kralidis@ccrs.nrcanDOTgc.ca>
Re: how to put each line of file to a variable? (Abigail)
Re: how to put each line of file to a variable? <tflynn@iastate.edu>
Re: how to put each line of file to a variable? <tflynn@iastate.edu>
Re: how to put each line of file to a variable? <tflynn@iastate.edu>
Re: how to put each line of file to a variable? (Kragen Sitaker)
Re: Is there any CTlib.pm documentation ? c_j_marshall@my-deja.com
Re: List files in a dir (Abigail)
Re: list of lists (Abigail)
Net::FTP help in output... <klrtl@home.com>
Next and Previous <ICEMOUNTAIN@prodigy.net>
Re: Next and Previous (Abigail)
Re: Perl Module for MS Access? <hartleh1@westat.com>
Re: perl related question now! <ysroh@chat.carleton.ca>
Porting Perl script to Win32 perl <nghthawk@hal-pc.org>
Re: Positioning the Cursor on a terminal <tech@tburg.net>
Re: progressiv bar when uploading... (Michel Dalle)
Re: Qns about passing by reference, etc (Abigail)
Re: range of array indexes (Kragen Sitaker)
Re: s/// conditional substitution (Abigail)
Re: s/// conditional substitution <picaza@chsi.com>
Re: s/// conditional substitution <uri@sysarch.com>
Saving a list of filenames from directory into an array <dgscapin@castaway.cc.uwf.edu>
Re: Saving a list of filenames from directory into an a (Kragen Sitaker)
Re: target frame in URL redirection (Abigail)
Re: target frame in URL redirection <hartleh1@westat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 20 Sep 1999 23:23:32 +0600
From: "Aleksey Zvyagin" <zal@rest.ru>
Subject: Языки программирования, технология разработки ПО и многое другое
Message-Id: <7s5qh6$d6g$1@news.mplik.ru>
Все о языках программирования C/C++, Delphi, Perl, Java, статьи, исходные
тексты
http://pingwin.net.ru/node/folder-0768/
Технологии программирования: как разрабатывают софт в Майкрософт, CASE
средства, о надежности ПО и многое другое:
http://pingwin.net.ru/node/ProgTechno/
Все это в самом дружественном, большом каталоге ПИНГВИН -
http://pingwin.net.ru/
------------------------------
Date: Mon, 20 Sep 1999 14:20:52 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
To: Anders Wallin <anders.wallin@sebank.se>
Subject: Re: Anomymous Hash
Message-Id: <x3yr9jt78cc.fsf@tigre.matrox.com>
[posted and CCed]
Anders Wallin <anders.wallin@sebank.se> writes:
> Example:
> SWEDEN
> STOCKHOLM
> street1
> street2
> LUND
> street1
> street3
> NORWAY
> OSLO
> street 1....
my $struct = {
'SWEDEN' => {
'STOCKHOLM' => [
'street1',
'street2',
],
'LUND' => [
'street1',
'street3',
],
},
'NORWAY' => {
'OSLO' => [
'street1',
],
},
};
> It seemed that the concept of anonymous hashes could be useful. I am
> however stuck getting this to work (both creating the hashes and
> printing them). I would greatly appreciate any help.
I show an anonymous hash above, but it could be a regular hash as
well. Explanation:
1) $struct is a reference to an anonymous hash (call it h1).
2) The keys to h1 are the names of the countries (SWEDEN, NORWAY,
etc.. ). The value of each key is a reference to another anonymous
hash (call it h2).
3) The keys to h2 are the names of the cities of the respective
countries (STOCKHOLM, LUND). The value of each key is a reference to
an anoymous array (call is ar1).
4) The array ar1 contains the streets of each respective city.
For more information on Perl's way of creating complex data
structures, check out perldsc and perlref.
HTH,
--Ala
------------------------------
Date: Mon, 20 Sep 1999 14:54:16 -0600
From: Carl Montgomery <cmontgomery@campuspipeline.com>
Subject: Configuring @INC for a movable Perl dist.
Message-Id: <37E69EF8.6B680CB@campuspipeline.com>
Help!
I am building a Perl distribution on a local machine to be deployed to
various places on clients' machines. I originally built the dist in
/tmp/perl5, but each machine will have the dist in a different place.
When installing the Perl dist on other machines I modify Config.pm and
.packlist; but all Perl scripts fail because @INC is still set to
"/tmp/perl5....".
How can I change @INC to include the right set of dirs when I don't know
the right dirs until installing Perl dist?
------------------------------
Date: Mon, 20 Sep 1999 14:46:58 -0400
From: <ICEMOUNTAIN@prodigy.net>
Subject: Re: Constructing a next/more feature for a list display using PERL (CGI)
Message-Id: <7s6039$5274$1@newssvr04-int.news.prodigy.com>
I have a script that uses that. You can see the source code for it at
http://www.3gc.net/galleryscript.txt I had help with this script so I don't
know how to have a previous link and there is always a next link even when
there isn't anything else there. I'm going to try and figure out a way to
fix that.
------------------------------
Date: Mon, 20 Sep 1999 01:03:49 GMT
From: sthoenna@efn.org (Yitzchak Scott-Thoennes)
Subject: Re: CONTEST: Range Searching
Message-Id: <1fY53gzkgmXF092yn@efn.org>
In article <r+R53gzkgCYS092yn@efn.org>,
sthoenna@efn.org (Yitzchak Scott-Thoennes) wrote:
>Combining this with options stuff shamelessly stolen from Kevin Reid, I get:
Please disregard the earlier posting of a test version.
Here's what I meant to post:
#!perl -wn
use strict;
use vars qw/$opt_A $opt_B $opt_C $end $pat @lines/;
use Getopt::Std;
BEGIN {
getopts('C:B:A:') and $pat = shift or usage();
foreach ($opt_A, $opt_B) {$_ ||= $opt_C || 0 unless defined $_; }
$pat =~ s#^/(.*)/$#$1#;
sub usage {print <<"END" and exit 1}
$0 [-B lines] [-A lines] [-C lines] /pattern/ [files...]
-B n Print n lines before the match
-A n Print n lines after the match
-C n Print n lines before and after the match
Slashes on the pattern are optional.
END
}
if (/$pat/o and $end = $. + $opt_A or $end and $. <= $end) {
print splice(@lines,0), $_;
} else {
push @lines, $_;
shift @lines if @lines > $opt_B;
}
$end = @lines = () if eof;
------------------------------
Date: Mon, 20 Sep 1999 17:56:22 GMT
From: jakoye <jakoye@my-deja.com>
Subject: Converting Perl pages from ODBC to OLE
Message-Id: <7s5sg0$r00$1@nnrp1.deja.com>
I have been thrust in a rather uneviable role. I have been tasked with
changing the database connection code for some Perl pages without
knowing much about Perl. I've looked at Perl pages, and can understand
what's going on for the most part, but I've never written one myself.
But that does not matter to the powers that be, I am a "programmer" so
therefore it is I who should reprogram these Perl pages. Fine. The
problem is, I cannot find any examples anywhere (O'Reilly book
Programming Perl, various websites inc. www.perl.com &
www.activestate.com) on how to change, or even establish, database
connection calls. Here's some of the code in the pages as it is now
using ODBC connection:
#!/usr/local/bin/perl
use Win32::ODBC;
//This is at the beginning of the page. I assume I would change ODBC to
//OLEDB, right?
$DSN = "BusinessMgmt";
$db = new Win32::ODBC($DSN);
//This is later in the code when a database connection is actually
//being made. Again, I would assume I change ODBC to OLEDB, right?
I don't see any other code within the page that indicates it has
anything to do with database connectivity. I don't understand how the
Perl page could know where the database is since it is never given a
path to it, but again, I do not know Perl so maybe I'm missing
something.
Just changing ODBC to OLEDB everywhere it occurs in the code seems too
simple, but it's also the obvious thing to do. Am I right here or
sniffing up the wrong tree? Any help would be appreciated. If anyone
can point me to online resources which deal with database connections
within Perl, I would appreciate that as well.
Thank you.
--
"Show me a good loser and I'll show you a loser"
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 20 Sep 1999 13:22:20 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Help me to make it work...please
Message-Id: <x3yso497b1v.fsf@tigre.matrox.com>
"Dmitry Sergeyev" <root@spb.to> writes:
> Hi,
> I wrote such module:
[snip]
You really really really (and I mean REALLY) need to start using loops
now. Checkout the documentation on foreach() and while().
I would also look into using the AUTOLOAD method to avoid a lot of
redundancy in your module.
--Ala
------------------------------
Date: 20 Sep 1999 19:55:51 GMT
From: Young-Soo Roh <ysroh@chat.carleton.ca>
Subject: How to password a file?
Message-Id: <37E69273.7C8BC518@chat.carleton.ca>
Hi!
If anyone knows the way to solve this problme, please help!!
I have some files under my public_html and I want them to be somehow
only
downloadable by selected users off the net because I don't want anybody
to
download the file.
Is there any way to lock the file?
or
asks username and password when somebody try to open file from the web.
(actually there are some site with this feature, but I don't know how to
do it)
Please help! help!
Thanks in advance.
------------------------------
Date: 20 Sep 1999 15:06:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to password a file?
Message-Id: <slrn7ud53e.ae4.abigail@alexandra.delanet.com>
Young-Soo Roh (ysroh@chat.carleton.ca) wrote on MMCCXI September MCMXCIII
in <URL:news:37E69273.7C8BC518@chat.carleton.ca>:
[]
[] If anyone knows the way to solve this problme, please help!!
[]
That's not a Perl question. And your newsreader inserts random newlines.
Go away.
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 15:56:18 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: how to put each line of file to a variable?
Message-Id: <37E69162.9169CE0D@ccrs.nrcanDOTgc.ca>
Hi,
I'm writing a script to extract and manipulate some data, across various
files, and am trying to store every line in a speceific file to an array
variable, so I can extract the appropriate data from there.
So far I can
open(GCPREP, "fltcor/$file.gcprep") or die "Yikes: $!\n";
while (<GCPREP>)
{
print "\L$1\n" if m/^\s(\d{6}.*$).*$/i;
}
This reports all lines that I'm looking for (number of lines vary from
file to file. How can I assign each these lines to an array?
Thanks, any advice is valued.
..Tom
-----------------------------------------------------------------------------------------
Tom Kralidis Geo-Spatial Technologist
Canada Centre for Remote Sensing Tel: (613) 947-1828
588 Booth Street , Room 241 Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------
------------------------------
Date: 20 Sep 1999 15:19:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to put each line of file to a variable?
Message-Id: <slrn7ud5r8.ae4.abigail@alexandra.delanet.com>
Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote on MMCCXI September
MCMXCIII in <URL:news:37E69162.9169CE0D@ccrs.nrcanDOTgc.ca>:
__ Hi,
__
__ I'm writing a script to extract and manipulate some data, across various
__ files, and am trying to store every line in a speceific file to an array
__ variable, so I can extract the appropriate data from there.
__
__ So far I can
__ open(GCPREP, "fltcor/$file.gcprep") or die "Yikes: $!\n";
__ while (<GCPREP>)
__ {
__ print "\L$1\n" if m/^\s(\d{6}.*$).*$/i;
__ }
__
__ This reports all lines that I'm looking for (number of lines vary from
__ file to file. How can I assign each these lines to an array?
Well, if the file isn't too large, or if you want to store most of the
lines anyway, you can use grep:
open ....
my @array = grep {/^\s\d{6}/} <GCPREP>;
Else, you would use push:
open ....
my @array = ();
/^\s\d{6}/ && push @array => $_ while (<GCPREP>);
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 15:39:10 -0500
From: "Timothy J Flynn" <tflynn@iastate.edu>
Subject: Re: how to put each line of file to a variable?
Message-Id: <7s661g$o8f$1@news.iastate.edu>
oops, I just saw that you wanted this to work over multiple files. Then you
would set $i first. then go through the loop that opens and closes your
files and put this in the guts minus the $i=0; Then at file2 you would
start where you left off at file1 ... etc file3 ... file4..... and so on..
-Tim
Timothy J Flynn <tflynn@iastate.edu> wrote in message
news:7s65m5$m84$1@news.iastate.edu...
> $i=0;
> while (<GCPREP>)
> {
> if (/pattern you are looking for/)
> {
> $SOMEARRAY[$i] = $_;
> $i++;
> }
> }
>
> or if you want all the lines.
> while (<GCPREP>)
> {
> $i=0;
> $SOMEARRAY[$i] = $_;
> $i++;
> }
>
> Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote in message
> news:37E69162.9169CE0D@ccrs.nrcanDOTgc.ca...
> > Hi,
> >
> > I'm writing a script to extract and manipulate some data, across various
> > files, and am trying to store every line in a speceific file to an array
> > variable, so I can extract the appropriate data from there.
> >
> > So far I can
> > open(GCPREP, "fltcor/$file.gcprep") or die "Yikes: $!\n";
> > while (<GCPREP>)
> > {
> > print "\L$1\n" if m/^\s(\d{6}.*$).*$/i;
> > }
> >
> > This reports all lines that I'm looking for (number of lines vary from
> > file to file. How can I assign each these lines to an array?
> >
> > Thanks, any advice is valued.
> >
> > ..Tom
> >
> >
>
> --------------------------------------------------------------------------
> ---------------
> > Tom Kralidis Geo-Spatial Technologist
> > Canada Centre for Remote Sensing Tel: (613) 947-1828
> > 588 Booth Street , Room 241 Fax: (613) 947-1408
> > Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
>
> --------------------------------------------------------------------------
> ---------------
>
>
------------------------------
Date: Mon, 20 Sep 1999 15:30:49 -0500
From: "Timothy J Flynn" <tflynn@iastate.edu>
Subject: Re: how to put each line of file to a variable?
Message-Id: <7s65m5$m84$1@news.iastate.edu>
$i=0;
while (<GCPREP>)
{
if (/pattern you are looking for/)
{
$SOMEARRAY[$i] = $_;
$i++;
}
}
or if you want all the lines.
while (<GCPREP>)
{
$i=0;
$SOMEARRAY[$i] = $_;
$i++;
}
Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote in message
news:37E69162.9169CE0D@ccrs.nrcanDOTgc.ca...
> Hi,
>
> I'm writing a script to extract and manipulate some data, across various
> files, and am trying to store every line in a speceific file to an array
> variable, so I can extract the appropriate data from there.
>
> So far I can
> open(GCPREP, "fltcor/$file.gcprep") or die "Yikes: $!\n";
> while (<GCPREP>)
> {
> print "\L$1\n" if m/^\s(\d{6}.*$).*$/i;
> }
>
> This reports all lines that I'm looking for (number of lines vary from
> file to file. How can I assign each these lines to an array?
>
> Thanks, any advice is valued.
>
> ..Tom
>
>
> --------------------------------------------------------------------------
---------------
> Tom Kralidis Geo-Spatial Technologist
> Canada Centre for Remote Sensing Tel: (613) 947-1828
> 588 Booth Street , Room 241 Fax: (613) 947-1408
> Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
> --------------------------------------------------------------------------
---------------
------------------------------
Date: Mon, 20 Sep 1999 15:30:49 -0500
From: "Timothy J Flynn" <tflynn@iastate.edu>
Subject: Re: how to put each line of file to a variable?
Message-Id: <7s65i4$o3d$1@news.iastate.edu>
$i=0;
while (<GCPREP>)
{
if (/pattern you are looking for/)
{
$SOMEARRAY[$i] = $_;
$i++;
}
}
or if you want all the lines.
while (<GCPREP>)
{
$i=0;
$SOMEARRAY[$i] = $_;
$i++;
}
Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote in message
news:37E69162.9169CE0D@ccrs.nrcanDOTgc.ca...
> Hi,
>
> I'm writing a script to extract and manipulate some data, across various
> files, and am trying to store every line in a speceific file to an array
> variable, so I can extract the appropriate data from there.
>
> So far I can
> open(GCPREP, "fltcor/$file.gcprep") or die "Yikes: $!\n";
> while (<GCPREP>)
> {
> print "\L$1\n" if m/^\s(\d{6}.*$).*$/i;
> }
>
> This reports all lines that I'm looking for (number of lines vary from
> file to file. How can I assign each these lines to an array?
>
> Thanks, any advice is valued.
>
> ..Tom
>
>
> --------------------------------------------------------------------------
---------------
> Tom Kralidis Geo-Spatial Technologist
> Canada Centre for Remote Sensing Tel: (613) 947-1828
> 588 Booth Street , Room 241 Fax: (613) 947-1408
> Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
> --------------------------------------------------------------------------
---------------
------------------------------
Date: Mon, 20 Sep 1999 20:57:04 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: how to put each line of file to a variable?
Message-Id: <AcxF3.22848$N77.1809419@typ11.nn.bcandid.com>
In article <7s661g$o8f$1@news.iastate.edu>,
Timothy J Flynn <tflynn@iastate.edu> wrote:
>oops, I just saw that you wanted this to work over multiple files. Then you
>would set $i first.
Or you could just push @SOMEARRAY, $_; and not have to have an $i at all.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 20 Sep 1999 17:57:02 GMT
From: c_j_marshall@my-deja.com
Subject: Re: Is there any CTlib.pm documentation ?
Message-Id: <7s5sh7$r07$1@nnrp1.deja.com>
Perfect - thanks a lot.
In article <37E28B73.78FC7682@kawo2.rwth-aachen.de>,
Alex Farber <alex@kawo2.rwth-aachen.de> wrote:
> Chris,
>
> c_j_marshall@my-deja.com wrote:
> > Hi - can anyone please point me in the direction of some
>
> try http://www.mbay.net/~mpeppler/
>
> Regards
> Alex
>
> --
> Собираю статьи про JavaScript, Perl и др. на
http://simplex.ru/news.html
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 20 Sep 1999 13:20:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: List files in a dir
Message-Id: <slrn7ucurn.ae4.abigail@alexandra.delanet.com>
Bart Lateur (bart.lateur@skynet.be) wrote on MMCCXI September MCMXCIII in
<URL:news:37ecfab7.4685322@news.skynet.be>:
;; Abigail wrote:
;;
;; >I think your solution classifies as a
;; >trivial, uninteresting one that doesn't work.
;;
;; And what of systems where "ls" doesn't work? If you dismiss a solution
;; that doesn't work for some rather exceptional cases, yours certainly
;; must be dismissed as being too system dependant. `ls` is not perl!
Use of `` certainly is Perl. For getting a directory listing, you want ls.
As for argueing that my solution doesn't always work, that's certainly
true - but then *I* didn't start posting articles saying that the
solutions of the "regulars" were trivial and uninteresting, and suggesting
that my solution would work were the solution of the "regulars" wouldn't.
;; >;; print <<"END_OF_HTML";
;; >
;; >So, where's the <!DOCTYPE ... > ?
;;
;; True, but irrelevant. You're nitpicking on "valid HTML", and this
;; doesn't quite belong in this newsgroup. :-) And I mainly want to
;; generate something that can be used inside a HTML document, not a
;; complete HTML document, so this header needn't be generated, if the
;; complete document already contains it.
Ah, that certainly explains why you generated HTML and BODY tags, and a
valid HEAD element. It's for all those documents that contain a DOCTYPE
and nothing else!
;; >;; opendir(DIR, $dir);
;;
;; >And if the opendir fails?
;;
;; Then, under -w,
;;
;; my @list = sort readdir(DIR);
;;
;; will generate a warning.
And will it tell you *why* the opendir failed?
Abigail
--
perl -wlne '}{print$.' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 20 Sep 1999 14:02:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: list of lists
Message-Id: <slrn7ud1au.ae4.abigail@alexandra.delanet.com>
Andreas Kneifel (kneifan@pool.informatik.rwth-aachen.de) wrote on MMCCXI
September MCMXCIII in <URL:news:37E63CA4.14C68107@pool.informatik.rwth-aachen.de>:
^^ Hello,
^^ I`ve the following problem creating a lists, that contains lists:
^^
^^ push(@array1,@array2);
^^
^^ pushes every element of array2 as one element on array1, but not the
^^ hole list/array as one element.
^^ I hope this is possible without using references (because I have to puth
^^ several lists on array1 that way, and build these lists by just one
^^ loop.)
No, it isn't. If you want a list of lists, you will have references.
I don't see why you don't want to use references. The argument you use
doesn't make much sense.
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 18:45:07 GMT
From: "Joel Blanchette" <klrtl@home.com>
Subject: Net::FTP help in output...
Message-Id: <TgvF3.280$s6.8906@news1.rdc2.on.home.com>
Hello all,
I am trying to make a ftp program. I have been able to connect to the
server and viewing this by doing a print $ftp->message; but my problem is
that I want to know everything that come out. In the readme file it said
to put the degug to something more then 0 so i did
$ftp = Net::FTP->new('my.server', Debug => 1);
but where do you get the info???? what i need is something like:
Net::FTP=GLOB(0x8152974)<<< 220 imagine FTP server (Version wu-2.4(5) Tue
Jul 29 11:17:18 CDT 1997) ready.
Net::FTP=GLOB(0x8152974)>>> user gbarr
Net::FTP=GLOB(0x8152974)<<< 331 Password required for gbarr.
Net::FTP=GLOB(0x8152974)>>> PASS ....
Net::FTP=GLOB(0x8152974)<<< 230 User gbarr logged in. Access restrictions
apply.
Net::FTP=GLOB(0x8152974)>>> QUIT
Net::FTP=GLOB(0x8152974)<<< 221 Goodbye.
but it woild be better is the Net::FTP=GLOB(0x8152974)<<< would be out but
that is still ok to have... but I want all that info. How do I do the
output????
Hope you can help me out.
Thanks in advance...
Joel
------------------------------
Date: Mon, 20 Sep 1999 14:59:57 -0400
From: <ICEMOUNTAIN@prodigy.net>
Subject: Next and Previous
Message-Id: <7s6095$3o50$1@newssvr04-int.news.prodigy.com>
I have a script that displays a Camaro Gallery on my website and I have it
so that it only displays 5 per page. But there is always a next link there
even when there isn't anymore pictures, and how would I put a previous link
on it. For some reason when I put Z28 in the "model" field it doesn't work
and there are Z28's in the database. The source code for the script is at
http://www.3gc.net/galleryscript.txt and the script is at
http://www.3gc.net/cgi-bin/scripts/gallerysearchtest3.cgi?model=RS
------------------------------
Date: 20 Sep 1999 15:25:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Next and Previous
Message-Id: <slrn7ud66c.ae4.abigail@alexandra.delanet.com>
ICEMOUNTAIN@prodigy.net (ICEMOUNTAIN@prodigy.net) wrote on MMCCXI
September MCMXCIII in <URL:news:7s6095$3o50$1@newssvr04-int.news.prodigy.com>:
== I have a script that displays a Camaro Gallery on my website and I have it
== so that it only displays 5 per page. But there is always a next link there
== even when there isn't anymore pictures,
Well, don't put one there then!
== and how would I put a previous link
== on it.
The same way as you put in next links, basically.
== For some reason when I put Z28 in the "model" field it doesn't work
== and there are Z28's in the database.
Well, I guess you have a bug then. *shrug*. What else do you expect as an
answer if all you say is "it doesn't work"?
== The source code for the script is at
== http://www.3gc.net/galleryscript.txt and the script is at
== http://www.3gc.net/cgi-bin/scripts/gallerysearchtest3.cgi?model=RS
Well, that's fine they are there. Are we now supposed to fetch our web
wowser, download the code and debug it for you? I don't think so.
If you have a specific problem about a specific part of the code, post
the code, and ask your question. If you have a usuage problem about a
program that you got from somewhere, contact its author, or tech support,
or whatever. Don't post your question in this group.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 16:45:52 -0400
From: HHH <hartleh1@westat.com>
Subject: Re: Perl Module for MS Access?
Message-Id: <37E69D00.706BCCDC@westat.com>
jdkronicz@my-deja.com wrote:
> Thanks to you and Eric for the responces. Just to clarify ... are you saying
> that using both DBD::ODBC and Win32::ODBC are suitable to use if I'm going to
> switch to a more robust database later or just DBD::ODBC?
If you plan/hope/expect to switch to a different database, I'd use
DBD::ODBC, not Win32::ODBC.
> Secondly, (please pardon the simplicity of the question) what do you mean
> when you say that they are both available from the active state repository?
> Does that mean that they are inherently a part of recent versions of Perl?
Win32::ODBC is included in the Active State distribution so if you have
Active State perl, you have it. If you want DBD::ODBC, once you install
Active State perl, go to a command prompt and type PPM. Type help for
available commands. What you want to do is:
install DBI
install DBD-ODBC
and you should be all set. This all assumes you are running on Win32,
naturally.
Henry
------------------------------
Date: 20 Sep 1999 20:45:40 GMT
From: Young-Soo Roh <ysroh@chat.carleton.ca>
Subject: Re: perl related question now!
Message-Id: <37E69E20.E7BA6455@chat.carleton.ca>
This is newsgroup for perl.
I posted this message because I was wondering something can be done by perl
cgi script.
Anyway, thank you to the person above for being nice.
But, One thing, you don't have right to say "go away".
I hope you don't talk to people like that even if you don't see them.
Loser.
Young-Soo Roh wrote:
> Hi!
>
> If anyone knows the way to solve this problme, please help!!
>
> I have some files under my public_html and I want them to be somehow
> only
> downloadable by selected users off the net because I don't want anybody
> to
> download the file.
>
> Is there any way to lock the file?
> or
> asks username and password when somebody try to open file from the web.
> (actually there are some site with this feature, but I don't know how to
> do it)
>
> Please help! help!
>
> Thanks in advance.
------------------------------
Date: Mon, 20 Sep 1999 14:29:45 -0500
From: Cheryl Brannan <nghthawk@hal-pc.org>
Subject: Porting Perl script to Win32 perl
Message-Id: <37E68B29.F4A3DFBF@hal-pc.org>
I've got a script to parse text from another page. The demo (at:
http://webreview.com/wr/pub/98/10/30/perl/index.html is a regular Perl
script that I am trying to utilize in a ASP page.
Here's what I've got after removing unusable bits:
<%@language=perlscript%>
<%
use CGI;
use CGI::Carp (fatalsToBrowser);
use LWP::Simple;
$URL = "http://www.foo.com/index.html";
unless (defined ($page = get($URL))) {
die "There was an error getting URL: $URL\n";
}
@page = split(/\n/,$page);
$start=0;
foreach $line (@page){
print "$line\n" if($start == 1);
if($line =~ /ul compact/){
$start = 1;
}
last if($line =~ /\/UL/);
}
%>
Basically the script is supposed to start parsing when it sees
"UL COMPACT" and stop after "/UL". Right now all I'm getting is a blank
page with the HTML / BODY tag stucture with nothing in between.
Thanks for any and all assistance.
--Cheryl
------------------------------
Date: Mon, 20 Sep 1999 15:33:35 -0400
From: "Robert W. Byrd" <tech@tburg.net>
Subject: Re: Positioning the Cursor on a terminal
Message-Id: <37E68C0F.487E16CA@tburg.net>
Daniel wrote:
>
> I am developing an interactive program that runs strictly in from the
> command line, but I don't want it to appear as if it is running from the
> command line. I know that in C there is a way to position the cursor on the
> screen/terminal and accept input from that position. What I was wondering
> is if anyone knew of a way to perform this same technique in perl. So that
> I will not have to continuously clear the screen with the \n and then
> redisplay the information just to accept a users input.
> Thanks,
> Daniel.
There is "perlmenu" on CPAN. I had a quick look at it, and it may do
what
you want it too. You'll need "curses" to run it.
.rob.
--
Robert W. Byrd | Completely Computer Friendly
tech@tburg.net | 67-B Oxford St., Tillsonburg, ON CA N4G 2G3
------------------------------------------------------------
We are dyslexic of Borg; prepare to have your ass laminated.
------------------------------
Date: 20 Sep 1999 19:48:37 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: progressiv bar when uploading...
Message-Id: <7s632l$4e6$1@xenon.inbe.net>
pvinh@claranet.fr (Vinh Philippe) wrote in <37DD4DCA.FD5CB151@claranet.fr>:
>Hello
>i've made a form which allow uploading file from pc computer.
>All goes right...so i'll expect to search lib or script which show a
>windows give the average of the uploading like on win95 system when
>transfering file...
>Is it possible?
>Thank and greetings From France :)))
>
One way to do it is to create an applet with a progress bar and
a socket connection to some daemon on your webserver. Your file
upload CGI might then send back some progress information via
the daemon while it's receiving the file...
Seems rather heavy, no ? Maybe there's a light-weight solution
somewhere else, in another newsgroup maybe :-)
Have fun,
Michel.
------------------------------
Date: 20 Sep 1999 14:08:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Qns about passing by reference, etc
Message-Id: <slrn7ud1mj.ae4.abigail@alexandra.delanet.com>
Jonathan Teo (jonnyace@pacific.net.sg) wrote on MMCCXI September MCMXCIII
in <URL:news:37E662EA.633F6DD6@pacific.net.sg>:
'' I've been using Perl a bit now, but some points still escape me.
''
'' 1. How do sub-routines change value of variables? eg, how would you
'' write something like chop(&)?
Look up the manual about subroutines and what it says about @_.
'' 2. If a sub-routine creates an object (eg $x = new
'' SomeModule::SomeObject), how do you pass it out to the calling routine
'' without
'' $x being a global variable.
Look up the manual about subroutines and how values are returned.
'' 3. How do you redirect STDERR, eg, so that "die" messages will go into a
'' file rather than console?
That's explained in the manual in detail as well.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 18:09:04 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: range of array indexes
Message-Id: <4LuF3.22517$N77.1786699@typ11.nn.bcandid.com>
In article <7s5rm0$d51o$1@pike.uhc.com>, Peter Icaza <picaza@chsi.com> wrote:
>i seem to come up with this problem often and i think that there must be a
>better way. i want to put into a string, array elements x thru the end of
>array. something like:
> $str = array[$x-$#array];
>or
>$str = join(' ', array[$x-$#array] );
#!/usr/bin/perl -w
use strict;
my @array = qw(Now is the time for all good men to read their documentation
very thoroughly.);
my $x = 2;
my $str = join ' ', @array[$x..$#array];
print $str, "\n";
>i dont find anything addressing this. any pointers to resources or is this
>"wish list" item a fantasy?
Perldoc perlop will tell you about the .. operator, although it's
confusing the first time you read it. I don't know how you'd find out
about array slicing, before finding out what you want is called array
slicing, except by reading the docs thoroughly.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 20 Sep 1999 13:33:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: s/// conditional substitution
Message-Id: <slrn7ucvkk.ae4.abigail@alexandra.delanet.com>
Peter Icaza (picaza@chsi.com) wrote on MMCCXI September MCMXCIII in
<URL:news:7s5qu2$adr6$1@pike.uhc.com>:
__ hi,
__ thanks to all for the help
__
__ this is what i came up with:
__ if ($subsetCriteria[$X] =~ (s/(.*) +(in|ex)clude +'?(.*)\b'?\s+(.*)/($2 eq
__ "in" ?"(_RC$Ctr = '1') $4":"^(_RC$Ctr = '1') $4")/e))
__
__ i would have like it better as something like:
__ if ($subsetCriteria[$X] =~ (s/(.*) +(in|ex)clude +'?(.*)\b'?\s+(.*)/($2
__ eq "in" ?"" : "^")(_RC$Ctr = '1') $4/e))
__ but alas it doesnt work that way :(
Of course not. It isn't valid Perl. Strings are delimited with quotes, and
one uses the . operator to concatenate strings. Just postpending a string
surrounded by parens is never going to work.
if ($subsetCriteria[$X] =~
s/(.*) +(in|ex)clude +'?(.*)\b'?\s+(.*)/
($2 eq "in" ? "" : "^") . "_RC$Ctr = '1' $4"/e)
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 15:15:03 -0400
From: "Peter Icaza" <picaza@chsi.com>
Subject: Re: s/// conditional substitution
Message-Id: <7s612q$6mb8$1@pike.uhc.com>
yes this is better. the /x didnt want to work...i'll try it later
s/(.*) +(in|ex)clude +'?(.*)\b'?\s+(.*)/$hash{$2}(_RC$Ctr = '1') $4")/
------------------------------
Date: 20 Sep 1999 16:05:13 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: s/// conditional substitution
Message-Id: <x767158i2u.fsf@home.sysarch.com>
>>>>> "PI" == Peter Icaza <picaza@chsi.com> writes:
PI> yes this is better. the /x didnt want to work...i'll try it later
PI> s/(.*) +(in|ex)clude +'?(.*)\b'?\s+(.*)/$hash{$2}(_RC$Ctr = '1') $4")/
/x works fine. what did you try? this whole regex of yours is not
clear. show some input and output text examples. why are the ' chars
modified with ? that could just become (?:'.*')? also the \b before the
' doesn't compute with me. so show some examples and we can make this
a much simpler regex.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Mon, 20 Sep 1999 15:34:53 -0400
From: George <dgscapin@castaway.cc.uwf.edu>
Subject: Saving a list of filenames from directory into an array.
Message-Id: <37E68C5C.3A78@castaway.cc.uwf.edu>
I am trying to find a way to save a list of jpeg and gif filenames from
a given directory into an array. I just need a simple way to do this.
Thank you in advance for the help. I have tried some suggestions from
the gurus through reading similar problems but haven't had any luck, so
I need an answer to my specific problem.
george@thescapins.com
------------------------------
Date: Mon, 20 Sep 1999 20:22:06 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Saving a list of filenames from directory into an array.
Message-Id: <OHwF3.22793$N77.1804914@typ11.nn.bcandid.com>
In article <37E68C5C.3A78@castaway.cc.uwf.edu>,
George <dgscapin@castaway.cc.uwf.edu> wrote:
>I am trying to find a way to save a list of jpeg and gif filenames from
>a given directory into an array. I just need a simple way to do this.
>Thank you in advance for the help. I have tried some suggestions from
>the gurus through reading similar problems but haven't had any luck, so
>I need an answer to my specific problem.
#!/usr/bin/perl -w
use strict;
my $dir = '/home/kragen/public_html';
opendir DIR, $dir or die "couldn't opendir $dir: $!";
my @files = grep { /\.(jpeg|gif)$/ } readdir DIR;
print "got @files\n";
Output:
got textoval3.gif sgi_snap.gif
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 20 Sep 1999 14:11:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: target frame in URL redirection
Message-Id: <slrn7ud1rf.ae4.abigail@alexandra.delanet.com>
Wesley Warren (wcwarren@primus.com.au) wrote on MMCCXI September MCMXCIII
in <URL:news:937834693.380537@diddley.primus.com.au>:
--
-- I'm trying to specify a target frame in a URL redirection...
That's not a Perl question.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 20 Sep 1999 17:03:41 -0400
From: HHH <hartleh1@westat.com>
Subject: Re: target frame in URL redirection
Message-Id: <37E6A12D.135C4BCC@westat.com>
Wesley Warren wrote:
> My guess doesn't work:
> print ("Location: $go\n\n" target="4_display_area");
The \n\n (two of them) indicate the end of the header being sent. Try
this:
print "Location: wherever\nTarget=whatever\n\n" ;
Henry
------------------------------
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 858
*************************************