[13711] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1121 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 19 17:10:33 1999

Date: Tue, 19 Oct 1999 14:10:15 -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: <940367415-v9-i1121@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 19 Oct 1999     Volume: 9 Number: 1121

Today's topics:
    Re: newbie jspangen@my-deja.com
    Re: Oh god! Not another Net::ftp question! <t.dillerNOt.SPAM@xpres.com.invalid>
        Perl certification? bing-du@tamu.edu
        pod2text error <djanisse@northrock.bm>
    Re: Problem w/ PERL and SQL <kbandes@home.com>
        Searching <nospam@nospam.com>
    Re: System Requirement (Scott McMahan)
    Re: UNIX (Solaris 2.6) to NT ACCESS DB? <Darryl.Friesen@usask.ca>
    Re: Unix command =?ISO-8859-1?Q?=B4tree=B4?= in Perl? <gellyfish@gellyfish.com>
        url_param issue <mis@vanguardusa.com>
    Re: WHATS WRONG WITH THIS CODE? (Scott McMahan)
    Re: Why does this compile? (Mitchell Morris)
    Re: Why does this compile? (Tad McClellan)
    Re: why doesn't my script work? <sariq@texas.net>
    Re: Writing to a file <colin@dvdtimes.co.uk>
    Re: Writing to a file (Bill Moseley)
    Re: Writing to a file <nguyend7@msu.edu>
    Re: Writing to a file (Brett W. McCoy)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 19 Oct 1999 19:23:01 GMT
From: jspangen@my-deja.com
Subject: Re: newbie
Message-Id: <7uige5$pgg$1@nnrp1.deja.com>


> The file consists of lines of the following format:
>
> <someword>: <number_of_files> <filename1.txt> <filename1.txt> ....
>
> I want to do something like the following:
>
> while ($line = <FILE>) {
>    ($word, $number, $array_of_files) = split(" ", $line);
>
> but how would I get the array_of_files to work?
almost correct, try:

 ...
while (defined ($line = <FILE>)) {
  ($word, $number, @files) = split / /,$line;  # @files = array
  $word =~ s/^.*:$/; # ;-)
  ...
}


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Tue, 19 Oct 1999 13:33:55 -0700
From: Tim Diller <t.dillerNOt.SPAM@xpres.com.invalid>
Subject: Re: Oh god! Not another Net::ftp question!
Message-Id: <1c31fd54.5b0d28db@usw-ex0106-041.remarq.com>

In article <7uhghq$26i$1@nnrp1.deja.com>, Richard Lawrence
<ralawrence@my-deja.com> wrote:
> Many thanks to those who helped. I just have one more question :o)
> I now have the following working bit of code:
> #!/usr/bin/perl -w
> use strict;
> my $site = "<site>";
> my $uname = "<user name>";
> my $password = "<password>";
> my $path = "<file and path>";
> my $resp;
> use Net::FTP;
> $ftp = Net::FTP->new($site);
> die "no such site" if ($@);
> $resp = $ftp->login($uname,$password);
> die "bad uname/passwd" if (!$resp);
> $resp = $ftp->ls($path);
> die "no such file" if (!$resp);
> $ftp->quit;
> print "ok!\n";
> the problem is that it reports busy FTP servers as having a bad
> username or password. Is there any way I can make it report them as
> busy instead?
> Regards
> Rich

Hi!

I suppose you could look at the response from the FTP server and look
for a string like 'anonymous user limit reached' or something.  I don't
know if there is a standard for a busy response, so it may be hard to
catch.

Anyone else?

Tim



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



------------------------------

Date: Tue, 19 Oct 1999 19:13:46 GMT
From: bing-du@tamu.edu
Subject: Perl certification?
Message-Id: <7uifsu$p2h$1@nnrp1.deja.com>

Hello all...

Is there any certification exam for Perl?

Bing


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Tue, 19 Oct 1999 20:31:51 GMT
From: "Darren Janisse" <djanisse@northrock.bm>
Subject: pod2text error
Message-Id: <Xy4P3.1323$hK6.72785@monger.newsread.com>


Hello,

Could anyone provide information on how to fix this error when attempting to
run pod2text:

        Can't locate object method "new" via package "Pod::Text" at
/usr/bin/pod2text line 61.

I've tried this on two different linux boxes, with the same results as
above.  v5.005 of perl.

Any help would be greatly appreciated!

Thank-you,
Darren Janisse





------------------------------

Date: Tue, 19 Oct 1999 17:00:50 -0400
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: Problem w/ PERL and SQL
Message-Id: <380CDC02.1E50E8EB@home.com>

Scratchie wrote:
> 
> mirak63@yahoo.com wrote:
> : When I push a scaler in to a SQL database (SQL 7)
> : the data shows up OK. However, when I retrieve the same
> : data using PERL, the data is truncated to 255 characters.
> 
> Just a wild guess, but it sounds like a problem with your database, not
> Perl.

Yup.  You're using SQL 7 but you've got an old version of DB-Library
and/or the ODBC driver.  It's documented in MSDN that this will
truncate to 255 characters.

Update your drivers.

Ken Bandes


------------------------------

Date: Tue, 19 Oct 1999 16:54:44 -0400
From: "Corey Martin" <nospam@nospam.com>
Subject: Searching
Message-Id: <7uilrg$234$1@nntp2.atl.mindspring.net>

I'm using the following code to request a page from eBay:


#!/usr/bin/perl

print "Content-type: text/html";

use strict;

use LWP::UserAgent;

$|++;

my $ua = new LWP::UserAgent;

$ua->agent("Gellzilla/666");

my $url =
'http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=178605262';

my $req = new HTTP::Request 'GET',$url;

my $res = $ua->request($req);
print $res->status_line,"\n";
print $res->content;



I want to search the resulting page for prices (something like $*) and copy
the first one I find in to a variable.  Is this as hard as I think?  What
code would I use?  I'd really appreciate any advice you could give me.

Thank You

--
Corey Martin
the web designer's centre
http://www.martin-web.com/centre/




------------------------------

Date: Tue, 19 Oct 1999 19:05:55 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: System Requirement
Message-Id: <ni3P3.1160$Mg4.103331@newshog.newsread.com>

Willie Lui (ltienheo@starnet.gov.sg) wrote:
>     Does anyone know what is the system requirement for me to install perl
> to an Unix system?

Perl has run on every form of UNIX I have ever used in my life, including
Xenix (really! :)), Ultrix, Dec's original Alpha OSF/1 thing, HP-UX,
AIX, Sun OS, Solaris, Atari MINIX (remember that? :)), FreeBSD, and
Linux. If your machine has enough oomph to run your flavor of UNIX,
it will run Perl as well as it runs anything else.

Unless you get a binary distribution (such as a Red Hat RPM for Linux),
you will need a C compiler which is capable of compiling the source.
Unlike most open source packages, a Perl install is attainable
by the newbie, perhaps contributing to its widespread success.

Scott


------------------------------

Date: Tue, 19 Oct 1999 19:44:11 GMT
From: Darryl <Darryl.Friesen@usask.ca>
Subject: Re: UNIX (Solaris 2.6) to NT ACCESS DB?
Message-Id: <7uihm8$qc4$1@nnrp1.deja.com>


> > I'll be Perl-processing some files on a UNIX-Solaris 2.6 machine
and would
> > like to directly update an Access DB (.mdb) residing on a NT machine
> > (intranet and NFS Maestro access to the NT filesystem).
>
> > Is this possible?  If so, hi-level how?
>
> The only way you could do this is to have a TCP/IP server running
> on the NT box, which did it for you, and pass parameters to it.
> Access itself is not a networkable database.

Can't you just set up the Access database as an ODBC data source (in
the ODBC control panel) and use perl and DBD::ODBC on the unix side?

I haven't actually done this yet, but plan on giving it a try over the
next week or so.


- Darryl

 ----------------------------------------------------------------------
  Darryl Friesen, B.Sc.                        Darryl.Friesen@usask.ca
  Programmer/Analyst                            http://gollum.usask.ca/
  Consulting & Development, Computing Services
  University of Saskatchewan                   "The Truth Is Out There"
 ----------------------------------------------------------------------


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 19 Oct 1999 20:23:13 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unix command =?ISO-8859-1?Q?=B4tree=B4?= in Perl?
Message-Id: <7uijvh$8f2$1@gellyfish.btinternet.com>

On Tue, 19 Oct 1999 09:56:21 +0200 Alex Rhomberg wrote:
> Daniel Apolinario wrote:
>> 
>>     I would like to know if anybody knows how to implement the unix
>> command ´tree´ in PERL language.
>>     Please, mail me if you know how to do it.
> 
> 
> Here is an implementation that seems to do the same as the 'tree'
> command
> on Solarit 2.5
> 
>  perl -le'print STDERR "tree: Command not found"; exit 1'
> 
> - Alex
> 
> PS The Linux boxes do it a bit differently

This should emulate correctly the Linux behaviour - with the added benefit
it will emulate the behaviour of any command if renamed as that command
a truly universal program :


#!/usr/bin/perl -w

use strict;

print STDERR qq{@{[$ENV{SHELL}=~m#([^/]+)$#]}: @{[$0=~m#([^/]+)$#]}: command not found\n} && exit 127;

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: 19 Oct 1999 12:21:43 PDT
From: "Brian A. Bard" <mis@vanguardusa.com>
Subject: url_param issue
Message-Id: <7uigc7$bbc@journal.concentric.net>

url_param() works fine on my NT 4.0 PWS machine but when the script goes up
to my Concentric Host Unix server it fails:  Software error:  Undefined
subroutine &main::url_param called at /cgi/prodpgs.cgi line 34.

Of couse I've got:  use CGI qw/:standard/;
and other functions from there work?

Any thoughts.




------------------------------

Date: Tue, 19 Oct 1999 19:08:41 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: WHATS WRONG WITH THIS CODE?
Message-Id: <Zk3P3.1163$Mg4.103331@newshog.newsread.com>

Jim (golf@tfz.net) wrote:

> It gives me a 500 error. All I want to know is if there are any errors in
> this code.

Run your program through "perl -c" on the command line first
and make sure Perl can swallow the code without choking. Rule
number one of CGI programming. Even a "trivial change" can
include finger checks and missing ; and ' etc.

Scott


------------------------------

Date: 19 Oct 1999 19:06:25 GMT
From: mgm@unpkhswm04.bscc.bls.com (Mitchell Morris)
Subject: Re: Why does this compile?
Message-Id: <slrn80pg9g.4hq.mgm@unpkhswm04.bscc.bls.com>

In article <7ui67j$bl9$1@pegasus.csx.cam.ac.uk>, M.J.T. Guy wrote:
[snip]
>
>Always use -w, particularly when you don't understand what's happening:
>
>$ perl -we '$foo = "Hello!" &jumbo;'
>Unquoted string "jumbo" may clash with future reserved word at -e line 1.
>Operator or semicolon missing before &jumbo at -e line 1.
>Ambiguous use of & resolved as operator & at -e line 1.
>Name "main::foo" used only once: possible typo at -e line 1.
>$
>
>
>That should offer some clues.
>
>
>Mike Guy

My new favorite trick, courtesy of Matthew Bafford, gives another view of
the same result:

$ perl -MO=Deparse,-p -e 'sub jumbo { 1; }' -e '$foo = "Hello!" &jumbo;'
-e syntax OK
sub jumbo {
	1;
}
($foo = ('Hello!' & jumbo()));



-- 
Mitchell Morris

When the people are being beaten with a stick, they are not much happier if
it is called "The People's Stick".
	-- Mikhail Bakunin (Statism and Anarchy) 


------------------------------

Date: Tue, 19 Oct 1999 10:55:56 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Why does this compile?
Message-Id: <sp0iu7.loc.ln@magna.metronet.com>

James Moody (moody+@pie.ius.cs.cmu.edu) wrote:

: A friend asked for help debugging a script he modified.  Basically, he added a
: couple of routines to someone else's script. 

[snip]

:     $foo = "Hello!";   #<--  Note this semicolon!

[snip]

: In this example $foo is created on assignment. 


   You should be using the "use strict" pragma you know.


:  Obviously, if you ran this,


   That would never happen.

   I don't run OPS (Other People's Scripts) if they don't have
   -w and use strict.

   (and I stop reading posts when I see those aren't in there)


   I waste enough time here on clpmisc, I don't need to go a-chasin'
   somebody else's bugs that a stupid machine is capable of finding.   :-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 19 Oct 1999 13:59:26 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: why doesn't my script work?
Message-Id: <380CBF8E.88DB7EBA@texas.net>

mr_potato_head@my-deja.com wrote:
> 
> Hi,
>   I have a small part of my script here and it works great when I run it
> from the command line.  But when I call this exact same script from my
> browser via cgi, then it get the wrong answer everytime.

Why did you crosspost to c.l.p.modules?  I don't see any modules being
utilized.

Two suggestions:

Please use a proper Subject line.  Read:

http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

Then, read 'The Idiot's Guide to Solving Perl CGI Problems' at:

http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html

HTH.  HAND.

- Tom


------------------------------

Date: Tue, 19 Oct 1999 20:39:15 +0100
From: "DVD Times" <colin@dvdtimes.co.uk>
Subject: Re: Writing to a file
Message-Id: <380cc90c$0$10070@znews.zetnet.co.uk>

> : What I want to do is take a value entered on an HTML form and store it
in a
> : file on the server so I can see what people have entered.
>
> And your perl question is?

How do you do it in Perl?  What else would it be!

--

Cheers,

Colin Polonowski
DVD Times - http://www.dvdtimes.co.uk/
** Region 1 and 2 DVD News, Reviews and Features **





------------------------------

Date: Tue, 19 Oct 1999 12:51:47 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Writing to a file
Message-Id: <MPG.12766bb2184e40de989811@nntp1.ba.best.com>

DVD Times (colin@dvdtimes.co.uk) seems to say...
> > : What I want to do is take a value entered on an HTML form and store it
> in a
> > : file on the server so I can see what people have entered.
> >
> > And your perl question is?
> 
> How do you do it in Perl?  What else would it be!

(On c.l.p.m?  Probably Python).

Oh!

Well, you would read the CGI.pm docs if you wanted to do it the easy 
way.

No. Wait.  Hiring a consultant is the easy way.

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


------------------------------

Date: 19 Oct 1999 19:51:53 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Writing to a file
Message-Id: <7uii4p$kv3$1@msunews.cl.msu.edu>

DVD Times <colin@dvdtimes.co.uk> wrote:
:> : What I want to do is take a value entered on an HTML form and store it
: in a
:> : file on the server so I can see what people have entered.
:>
:> And your perl question is?

: How do you do it in Perl?  What else would it be!

It's a cgi question, not a Perl question...  It would be possible to
accomplish the task with a shell script if need.




-- 
       Dan Nguyen          | It is with true love as it is with ghosts;
    nguyend7@msu.edu       | everyone talks of it, but few have seen it.
     dnn@debian.org        |               -Maxime De La Rochefoucauld
            25 2F 99 19 6C C9 19 D6  1B 9F F1 E0 E9 10 4C 16


------------------------------

Date: Tue, 19 Oct 1999 20:03:17 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Writing to a file
Message-Id: <slrn80pjsk.fdv.bmccoy@moebius.foiservices.com>

Also Sprach DVD Times <colin@dvdtimes.co.uk>:

>I'm new to Perl and I need a little guidance.
>
>What I want to do is take a value entered on an HTML form and store it in a
>file on the server so I can see what people have entered.
>
>Is there a simple piece of code to do this? If anyone could help I'd be very
>grateful.

Take a look at the documentation for CGI.pm -- it comes with the Perl
distribution and is very simple to use.  If you don't know how to look at
perl documentation, start with 'perldoc perldoc' at the command-line and
take it from there.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


------------------------------

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 1121
**************************************


home help back first fref pref prev next nref lref last post