[12563] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6163 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 10:07:25 1999

Date: Tue, 29 Jun 99 07:00:27 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 29 Jun 1999     Volume: 8 Number: 6163

Today's topics:
    Re: 2 simple (not to me tho) questions (I R A Aggie)
    Re: 2 simple (not to me tho) questions <gellyfish@gellyfish.com>
    Re: Apples and Oranges (Anno Siegel)
    Re: Command line parameters / Wildcard characters / Rec <tchrist@mox.perl.com>
    Re: Comparing two associative arrays <rick.delaney@home.com>
        CON.TIMEOUT <Ch1ckEn@hotmail.com>
    Re: DBI/Mysql help newbie <pat@ssih.com>
    Re: help with background <martin@adoma.se>
    Re: help with background (Marcel Grunauer)
        Help, always an error ?? <mark.stellaard@knoware.nl>
        How to send attachments with email <tdunbar@vt.edu>
    Re: How to supress output on STDERR in a called functio <tchrist@mox.perl.com>
    Re: I need help on easy topic <martin@adoma.se>
    Re: I need help on easy topic <gellyfish@gellyfish.com>
    Re: If use Netscape please read (Marcel Grunauer)
    Re: menu (Marcel Grunauer)
    Re: MIME TYPE <eng80386@nus.edu.sg>
    Re: MIME TYPE <gellyfish@gellyfish.com>
    Re: MIME TYPE <swiftkid@bigfoot.com>
    Re: MIME TYPE <martin@adoma.se>
    Re: MIME TYPE <martin@adoma.se>
    Re: MX record validation emarkert@my-deja.com
        Need help using umask. <wagener@cs.fsu.edu:NOSPAM>
        NET::FTP ->get(filename) #Check for Timeout schlagel@my-deja.com
    Re: Object persistence -- how to? <jll@skynet.be>
    Re: output the hexadecimal value of character from a st <garethr@cre.canon.co.uk>
    Re: PCI66 / UDMA66 / Ultra66 / Linux? (Stefaan A Eeckels)
    Re: PCI66 / UDMA66 / Ultra66 / Linux? <gellyfish@gellyfish.com>
        pipes !!! ??? <posern@informatik.uni-marburg.de>
    Re: pipes !!! ??? (Anno Siegel)
    Re: Proxy with Perl (Anno Siegel)
    Re: shortest self printing perl program (Marek Andricik)
    Re: Special Charecters converted from forms <garethr@cre.canon.co.uk>
    Re: Using Perl with an ADVFS filesystem... (Paul David Fardy)
    Re: Viral matters [completely off-topic] <tchrist@mox.perl.com>
        Week Number without Date Module? <riccardo.gubser@ubs.com>
    Re: Week Number without Date Module? (Dave Cross)
        win32 file access <kmassey@mratings.com>
        WIN32:OLE - Excel <burkhard.kiesel@med.siemens.de>
        yacc like tool <albrecht@cwi.nl>
    Re: yacc like tool <garethr@cre.canon.co.uk>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 29 Jun 1999 13:10:13 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <slrn7nhhi2.7t8.fl_aggie@thepentagon.com>

On 29 Jun 1999 02:41:10 GMT, Steve Lamb <morpheus@despair.rpglink.com>, in
<slrn7ngci6.ene.morpheus@rpglink.com> wrote:

+     The point is in the example I gave it made no difference.  In fact, in
+ most cases that I do that, I want it to make a new string.
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then what you're doing is OK. But you need to realize that some caution
is warranted.

+    I now refer *YOU* to page 10 of the Programming Perl book.

I refer you to my killfile. Have a nice day.

James


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

Date: 29 Jun 1999 14:34:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <3778cb65@newsread3.dircon.co.uk>

I R A Aggie <fl_aggie@thepentagon.com> wrote:
> On 29 Jun 1999 02:41:10 GMT, Steve Lamb <morpheus@despair.rpglink.com>, in
> <slrn7ngci6.ene.morpheus@rpglink.com> wrote:
> 
> +     The point is in the example I gave it made no difference.  In fact, in
> + most cases that I do that, I want it to make a new string.
>                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Then what you're doing is OK. But you need to realize that some caution
> is warranted.
> 
> +    I now refer *YOU* to page 10 of the Programming Perl book.
> 
> I refer you to my killfile. Have a nice day.
> 

At this point I would like to refer *everybody* to the label on the
keyboard of my computer here that says:

    WARNING:  Bodily injury may result from the misuse of this computer.
    Do not use this computer until you have first read and understood
    all of the product warnings and all of the user directions that are
    contained in the enclosed safety instruction manual.

/J\
-- 
"I thought homogenous culture was a kind of yogurt used to alleviate
thrush" - Ben Elton


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

Date: 29 Jun 1999 13:14:56 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Apples and Oranges
Message-Id: <7lagsg$46s$1@lublin.zrz.tu-berlin.de>

doug edmunds <edmundsMUNGED@pacifierMUNGED.com> wrote in comp.lang.perl.misc:
>Can anyone explain why the 'oranges' test (below) fails?
>In what way is a string that starts with a digit (other than 0) 
>different than any other string, or is this a bug?

It's a bug.  At least some might say perls support for symbolic
references is a bug.

>#Doug Edmunds 6/28/99
>Free Perl5 documentation in HTMLHelp format at 
>http://www.pacifier.com/~edmunds/perltools.html
>
>
>#--------code starts-----------
>
>#! perl -w
>#apples_and_oranges.pl
>
># -------- first test
>
>$a = "One apple";
>print "first - $a \n";
>
>$a_ref = \$a;
>$$a_ref = "Two apples";
>print "second - $a \n";

Here you have satisfied yourself that $a contains "Two apples".  In
particular it does not contain a reference to a variable (or an
anonymous place to store things to, for that matter).  So what
do you think $$a in the next line means?

>$$a = "Three apples";
>print "third - \$\$a is $$a  \$a is $a \n\n";

I'll have perl tell you what it means in a moment.  $$a is 
interpreted as a $, followed by some text, namely "Two apples".
which is, by means of the evil symbolic reference mechanism,
a variable.  In fact, in her infinite magnanimity, perl has
allowed you to create a variable with a blank in its name.
Go print ${'Two apples'} to see if it's true.  Then, change
"Two apples" above to "Two_apples" and just print $Two_apples,
without those pesky {...}.  Both will print "Three apples".

[some snippage]

># -------- third test
>
>$c = "1 orange";
>print "first - $c \n";
>
>
>$c_ref = \$c;
>$$c_ref = "2 oranges";
>print "second - $c \n";
>
>$$c = "3 oranges";  #the crash site

In the light of the above, you are trying to assign to a variable
with the name "2 oranges".  This is too much, even for perl.  I 
suppose the interpreter thinks you mean the variable $2 (one of
the regex related variables to which you can't assign).  In any
case, crash site indeed.

Had I ever needed convincing that symbolic references lead right
to the loony bin, this code would have done so.  It should probably
be archived somewhere to show to the I-need-to-assign-to-a-variable-
whose-name-I-read-from-a-file folks.

Anno


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

Date: 29 Jun 1999 05:39:56 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <3778b08c@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    tnguru@termnetinc.com (Ben Coleman) writes:
:>Yes, one is broken; and in blazes does the rest of the sentence mean?
:>Don't you *read* these messages before you actually post them?  
:
:Tom, I think the first of these two sentences is missing a word.  Didn't
:you read it before posting?

Both this and the other posting intentionally something out for comic
effect.  

--tom
-- 
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.


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

Date: Tue, 29 Jun 1999 12:38:46 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Comparing two associative arrays
Message-Id: <3778BE1A.29557C96@home.com>

[posted & mailed]

Uri Guttman wrote:
> 
> >>>>> "JC" == John Cochran <jdc@johnc.connectionsusa.com> writes:
> 
>   >> keys %hash1==keys %hash2 && "@{[values %hash1]}" eq "@{[@hash2{keys %hash1}]}"

[snip]

> i think you are mistaken. that expression is calling keys in a scalar
> context provided by ==. so it compares the number of keys in each which
> is a valid shortcut but not needed.

It is needed if %hash2 is a subset of %hash1.  It also won't always work
if any of the values of %hash1 are undef or "" for non-existent keys of
%hash2.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Tue, 29 Jun 1999 13:34:58 +0000
From: GiN <Ch1ckEn@hotmail.com>
Subject: CON.TIMEOUT
Message-Id: <3778CB82.5EA895B4@hotmail.com>

hi i have a problem
sometimes when i make a connection with "telnet" i get a timeout.
so when i use this perl script it just hang and dont give me a timeout
error
how can i solve this?


sub opsoc {
    chop($hostname = 'hostname');
    ($name, $aliases, $proto) = getprotobyname('tcp');
    ($name, $aliases, $port) = getservbyname($port,'tcp')
        unless $port =~ /^\d+$/;
    print "\nConnecting to SMTP server";
    ($name, $aliases, $type, $len, $thisaddr) =
gethostbyname($hostname);
    ($name, $aliases, $type, $len, $thataddr) = gethostbyname($server);

    if (socket(S, AF_INET, SOCK_STREAM, $proto)) {
        print ".";
    }
    else {
       print "\nSocket error. Exitting.\n\n";
       exit(0);
    }

    $sockaddr = 'S n a4 x8';
    $this = pack($sockaddr, AF_INET, 0, $thisaddr);
    $that = pack($sockaddr, AF_INET, $port, $thataddr);

    if (bind(S, $this)) {
        print "..";
    }
    else {
        die $!;
    }

    if (connect(S, $that)) {
        print "Connected.\n";
    }
    else {
        print "\nConnection refused.\n\n";
        exit(0);
    }
}



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

Date: Tue, 29 Jun 1999 13:05:29 GMT
From: Pat Traynor <pat@ssih.com>
Subject: Re: DBI/Mysql help newbie
Message-Id: <930661529.707.29@news.remarQ.com>

Faisal Nasim <swiftkid@bigfoot.com> wrote:
> See the pod pages of DBI module.

> perldoc DBI

Here's another problem that I'm having.  I saw that mentioned in another
article, and when I give the command "perldoc DBI", I get this error:

	pod2man: command not found

I'm on a Linux system and couldn't find binaries or sources to pod2man
anywhere.

The page still comes up, but the information is a bit skewed - like
viewing an nroff page without nroffing it.

--pat--
-- 
Pat Traynor
pat@ssih.com


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

Date: Tue, 29 Jun 1999 13:13:20 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: help with background
Message-Id: <3778B860.CDDCBCBC@adoma.se>



Peter Hodder wrote:
> 
> can someone tell me how to put a background image in a perl script.
> From Peter Hodder
> peterh@vk2kcf.stealth.com.au

take the script, put it in a Framemaker document.

Or put some coloured papers in your laser printer when you print it

Best regards Martin Quensel


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

Date: Tue, 29 Jun 1999 12:23:31 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: help with background
Message-Id: <377abab2.4686268@enews.newsguy.com>

On Tue, 29 Jun 1999 07:17:51 GMT, peterh@stealth.com.au (Peter Hodder)
wrote:

>can someone tell me how to put a background image in a perl script.
>From Peter Hodder

Use the -bgcolor switch when you run the script.

Marcel



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

Date: Tue, 29 Jun 1999 15:13:27 +0200
From: "Mark Stellaard" <mark.stellaard@knoware.nl>
Subject: Help, always an error ??
Message-Id: <7ladc9$22e$1@tasmania.dev.ict.nl>

Hello,

I'am desperate, I'm tring to write an upload perl script. But everytime I
got stuck at the same fault response:    Premature end of script headers:
/home/foo/script.cgi.
I read the Apache FAQ, and it say's something about HTTP headers it doesn't
get them, but I don't understand what ismeant by HTTP headers?
Can anybody help me with this question? And maybe he/she can see a BIG
mistake in the script below. I want to show the selected paramters from the
FORM into a HTML page,
I tried a @names in the HTML code but even when I try to run a simple script
like the oe below it gives the Premature end of script error????

Please help me !

_________Script code _________

$| = 1;
use CGI qw/:standard/;
$query = new CGI;

@names = $query->param;

print header;
print <<__END_OF_HTML_CODE__;
 <HTML>
  <HEAD>
   <TITLE>Test HTML Page</TITLE>
  </HEAD>
  <BODY>
   <H1>Parameters are:</H1>
  </BODY>
 </HTML>
__END_OF_HTML_CODE__








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

Date: Tue, 29 Jun 1999 09:51:56 -0400
From: Thomas Dunbar <tdunbar@vt.edu>
Subject: How to send attachments with email
Message-Id: <3778CF7C.1128A5AE@vt.edu>

How can i include attachments in email messages
generated via either piping directly to sendmail or
via Mail::Mailer or something similar

thanks,
       thomas


--
Thomas Dunbar    DBA,  IWA  (Information Warehousing and Access)
1900 Kraft Drive Suite 225  Virginia Tech
Blacksburg, Va. 24060-6363  Mail Code: 0457
tdunbar@vt.edu              540 231-3938       Fax: 540 231-8649





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

Date: 29 Jun 1999 07:11:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to supress output on STDERR in a called function
Message-Id: <3778c5f0@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, collin@rogowski.de (Collin Rogowski) writes:
:This works, but how do I open STDERR up again.
:"open STDERR" does not work.

You read the open() entry for the perlfunc manpage.

[ FORTY-EIGHT USELESSLY AFTER-THE-FACT QUOTED NOISE
  LINES DELETED ]

You really need to fix your newsreader.

--tom
-- 
I just hate to be pushed around by some fucking machine. - Ken Thompson, on the i960


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

Date: Tue, 29 Jun 1999 13:05:00 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: I need help on easy topic
Message-Id: <3778B66C.7C44DCE5@adoma.se>



Butcher wrote:
> 
> Hi, I have been using perl for 2 days =).
> I would just like to know the most common way in general that cgi
> programmers use to mail off form results to someone.  I want it to be mailed
> off server-side on an NT machine running IIS.  Also, I have noticed that
> most scripts dynamically create html results depending on the form input but
> i am wondering about url redirection based on form input.  I have bought the
> gecko book but it doesnt cover e-mailing form results.


Im not used to NT or IIS, so i wont ansver the mail question.

the other thing you wanted was to "redirect" user right?
well you do it by sending the location header  print "Location:
http://www.perl.org\n\n";


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

Date: 29 Jun 1999 13:27:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I need help on easy topic
Message-Id: <3778bbca@newsread3.dircon.co.uk>

Butcher <stupid_ass@nospam.hotmail.com> wrote:
> Hi, I have been using perl for 2 days =).
> I would just like to know the most common way in general that cgi
> programmers use to mail off form results to someone.  I want it to be mailed
> off server-side on an NT machine running IIS.  Also, I have noticed that
> most scripts dynamically create html results depending on the form input but
> i am wondering about url redirection based on form input.  I have bought the
> gecko book but it doesnt cover e-mailing form results.
> 

You might find : <http://www.geocities.com/SiliconValley/Park/8312/mail.htm>
useful ...

/J\
-- 
"Over the years I've always had Max Factor in my box" - Tina Earnshaw,
Chief Make-Up Artist, Titanic


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

Date: Tue, 29 Jun 1999 12:26:53 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: If use Netscape please read
Message-Id: <377bbaf1.4749719@enews.newsguy.com>

On Tue, 29 Jun 1999 02:30:33 -0500, Flounder Pounder
<flounder_pounder@telebot.com> wrote:

>Ok I am working on a search engine that searches a text database and am
>writing the database and search engine CGI in Perl
>(I love the pattern matching ;-D ) I have got  the search engine done if
>all I want it to do is search this text database so now what I need
>is more links and while I am work on a web bot and making the search
>engine more advanced (like letting it use META tags!) I need sites for
>the
>text database I only have 268 that is what I had in my Netscape
>bookmarks that is were you all come in I have written a program to take
>Netscape
>bookmarks and enter the links into the database (beats entering them one
>at a time!!!) So I was wondering if you would send me your Netscape
>bookmarks to add to the database. I will send you my bookmarks if you
>want me to but I would be very grateful to anyone who sent me theirs.
>
>
>
>PLEASE HELP ME WITH MY PROJECT BY SENDING ME YOUR NETSCAPE BOOKMARKS

Don't shout.

Not that your request has anything to do with Perl, but why not simply
bookmark any site you come across while you click your time away?

Or you could write a program with LWP that reads some links page or
even the result from a search engine query and stores those links in
your database.

Or is there a more sinister motive that I've missed?

Marcel



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

Date: Tue, 29 Jun 1999 12:32:39 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: menu
Message-Id: <377cbbb6.4946312@enews.newsguy.com>

On Tue, 29 Jun 1999 15:12:42 +0800, Tanya <tanya@i-cable.com> wrote:

>where can i download the full perl 5.00x user menu?

Come again?

User menu?

Do you mean the documentation? Follow links from www.perl.com, or go
directly to http://language.perl.com/info/documentation.html.

But you should already have the full Perl documentation on your hard
drive. It was installed along with Perl. As Tom Christiansen is wont
to say, if you don't have the documentation, you don't have Perl.

I like the 5.005_02 documention in PDF format, and it includes common
libraries like LWP as well.
http://www.perl.com/CPAN/authors/id/BMIDD/perlbook-5.005_02-a.tar.gz

Marcel



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

Date: Tue, 29 Jun 1999 18:41:30 +0800
From: "cwt" <eng80386@nus.edu.sg>
Subject: Re: MIME TYPE
Message-Id: <7la8ec$1hb$1@nobel2.pacific.net.sg>

That is not a misplaced HTML text.
It has a meaning which I'm not too sure .
What about  Content-Type: text/plain\n\n<pre>" ??

Thanks
cwt


Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:3778a234@newsread3.dircon.co.uk...
> cwt <eng80386@nus.edu.sg> wrote:
> > Hallo all,
> > Anyone has any idea what this header " Content-Type: text/html\n\n<pre>"
has
> > in difference with  "Content-Type: text/html\n\n" ??
> >
>
> Er no the *header* is the same.  The first one however is followed by
> some misplaced HTML tag ....  But what that has to do with Perl I really
> dont know.
>
> /J\
> --
> "While they're pumping, you're soaking them" - Speed Loader TV Advert




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

Date: 29 Jun 1999 12:14:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MIME TYPE
Message-Id: <3778aa9e@newsread3.dircon.co.uk>

cwt <eng80386@nus.edu.sg> wrote:
> That is not a misplaced HTML text.
> It has a meaning which I'm not too sure .
> What about  Content-Type: text/plain\n\n<pre>" ??
> 

I answered in response to your stealth mail - please can you fix it so
as you place some indication that you have posted and mailed - something
like :

   [ posted and mailed ]

before the attribution line is sufficient. 

/J\
-- 
"Tony Blair is reported to be detained indefinitely under plans unveiled
by the Home Secretary" - Corrupt Teletext Page


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

Date: Tue, 29 Jun 1999 16:08:16 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: MIME TYPE
Message-Id: <7lbcnq$57d1@news.cyber.net.pk>

How about:

print "Content-type: text/html\n\n<html><head><title>This is my
page</title></head></html>";

Anything after the \n\n is considered as the part of the web page.

print "Content-type: text/html\n\n<pre>";

After that, everthing is printed in plain text !

(<pre> is a standard html tag, you can see by view-source)

--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift  ICQ: 4265451
FAX: (815) 846-2877

cwt <eng80386@nus.edu.sg> wrote in message
news:7la8ec$1hb$1@nobel2.pacific.net.sg...
> That is not a misplaced HTML text.
> It has a meaning which I'm not too sure .
> What about  Content-Type: text/plain\n\n<pre>" ??
>
> Thanks
> cwt





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

Date: Tue, 29 Jun 1999 12:51:26 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: MIME TYPE
Message-Id: <3778B33E.FDF73AAE@adoma.se>



cwt wrote:
> 
> Hallo all,
> Anyone has any idea what this header " Content-Type: text/html\n\n<pre>" has
> in difference with  "Content-Type: text/html\n\n" ??

the header is "Content-Type: text/html" followed by 2 newlines
whatever comes after that isent a header, but the body of the document.
so... <pre> is a html tag, not something in the header.

and what is your perl question??

well here is a question for you! What does my name mean in english?

Best regards
Martin Quensel


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

Date: Tue, 29 Jun 1999 12:59:53 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: MIME TYPE
Message-Id: <3778B539.E38B3878@adoma.se>



cwt wrote:
> 
> That is not a misplaced HTML text.

yes it is. every HTML document should start with <HTML>.

> It has a meaning which I'm not too sure .

<pre> means preformatted or something. Its a usefull tag when your
dealing with ascii art for example

> What about  Content-Type: text/plain\n\n<pre>" ??

its an illegal HTML document.

here is a mind exercise for you.
is this a header just cause it is on one line??

print "Content-type: text/html\n\n<html><head><title>this is not a perl
issue</title></head><body><h1>This is not a perl issue</h1></html>";

Best regards Martin Quensel


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

Date: Tue, 29 Jun 1999 13:00:01 GMT
From: emarkert@my-deja.com
Subject: Re: MX record validation
Message-Id: <7lag0b$f65$1@nnrp1.deja.com>

In article <377833ea.67160378@news>,
  jbritain@home.com (Jim Britain) wrote:
> On Mon, 28 Jun 1999 05:33:15 +0000, "David L. Nicol"
> <david@kasey.umkc.edu> wrote:
>
> >Who has a good method for validating an e-mail domain exists?
> >
> >I'm looking for something tighter than
> >
> >sub GoodMXp($){my $hostname=shift;
> >  my $digreply=`(dig +pfmin $hostname; dig MX +pfmin $hostname)|grep
-v
> >^\;\;`;
> >  $digireply =~ m/\S/s and return 1;
> >  return 0;
> >};
>

As was stated get yourself a copy of Net::DNS and Email::Valid.
Email::Valid uses Net::DNS but offers some nice email address
validation features above and beyond what Net::DNS offers.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 29 Jun 1999 09:24:10 -0400
From: "Brian Wagener" <wagener@cs.fsu.edu:NOSPAM>
Subject: Need help using umask.
Message-Id: <7lah7g$g6d$1@news.fsu.edu>

I am having problems using umask.  The perl docs are very sparse on the
subject.  Well here is what I think I know and just tell me what is wrong.
umask sets the default permissions of the files that havent been made yet.
In my case I want all subsequent files to be made with full permission so I
tried "umask 0777" and it didn't work.  What am I doing wrong.
Thanks.
Bri




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

Date: Tue, 29 Jun 1999 11:25:10 GMT
From: schlagel@my-deja.com
Subject: NET::FTP ->get(filename) #Check for Timeout
Message-Id: <7laaeg$dct$1@nnrp1.deja.com>

Could someone forward a code snippet or help regarding (FTP get Timeout
issues). I am downloading many files from an ftp site on a daily basis
and would like to make sure that the FTP->GET (fn), will be able to
retrieve files successfully. If there is a timeout during a GET, is
there a way to capture the problem restart the download etc..?

#Code sample Running on Winnt4.0
$ftp = Net::FTP->new($hostname, Timeout => 60, Passive=> True);
if ($ftp){
   $ftp->login($username,$password);
   $ftp->cwd($DownloadDir);
   @entries = $ftp->ls($DownloadDir);
   foreach (@entries) {
     ($dir1,$dir2, $dir3, $filename1) = split(/\\/,$_);
     if (/org/){
      $ftp->get($filename1);
     ###?????
     ###What happens if error occurs, How can I trap?###
      print "[get $filename1]\n";
      }else{
	print "[skip $filename1]\n";
      }
  }
  $ftp->quit;
}else{
  print "could not open FTP connection";
}


regards,

Federico A. Schlagel
Business System Specialist
Hydrocarbons & Energy

Dow Europe S.A.
Bachtobelstrasse 3
CH-8810 Horgen
Switzerland


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 29 Jun 1999 15:44:18 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Object persistence -- how to?
Message-Id: <VA.000002a9.19419c55@godot>

> What is the best way to store an arbitrary object on disc?  Is there a
> persistence library of some sort?  

The best way depends on you exact needs. Several persistence solutions 
are available from CPAN, ranging from mere serialization (Storable, 
Data::Dumper, FreezeThaw) to object-relational mapping (DbFramework, 
Tangram) and interfacing with commercial object databases (ObjStore).

Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy



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

Date: Tue, 29 Jun 1999 11:03:49 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: drbrain@ziemlich.org (markus)
Subject: Re: output the hexadecimal value of character from a string
Message-Id: <sivhc79skq.fsf@cre.canon.co.uk>

markus <drbrain@ziemlich.org> wrote:
> I just tried to print for every character in a string its hexadecimal
> value. So e.g. the string is "ABC" it would print "0x29 0x30 0x31".

(Not in ASCII it wouldn't!)

Use `ord' to get the character code for the character, and the %x escape
in `printf' or `sprintf' to print it in hexadecimal.

-- 
Gareth Rees


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

Date: 29 Jun 1999 10:49:53 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: PCI66 / UDMA66 / Ultra66 / Linux?
Message-Id: <7la8ch$toi$1@justus.ecc.lu>

In article <37788b0c@newsread3.dircon.co.uk>,
	Jonathan Stowe <gellyfish@gellyfish.com> writes:
> 
> Well You've gotta have 'pootey to run Perl on havent you ?  I think it was
> a typo for 'comp.os.linux.hardware' actually ...
> 
> /J\

"I sign my paintings Vincent because people can't pronounce Van Gough"
- Vincent Van Gough

Just as much as this is a typo for 'Vincent Van Gogh' :-)

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
Perfection is reached, not when there is no longer anything to add,
but when there is no longer anything to take away. -- Saint-Exupiry



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

Date: 29 Jun 1999 13:56:21 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PCI66 / UDMA66 / Ultra66 / Linux?
Message-Id: <3778c275@newsread3.dircon.co.uk>

Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> wrote:
> In article <37788b0c@newsread3.dircon.co.uk>,
> 	Jonathan Stowe <gellyfish@gellyfish.com> writes:
>> 
>> Well You've gotta have 'pootey to run Perl on havent you ?  I think it was
>> a typo for 'comp.os.linux.hardware' actually ...
>> 
>> /J\
> 
> "I sign my paintings Vincent because people can't pronounce Van Gough"
> - Vincent Van Gough
> 
> Just as much as this is a typo for 'Vincent Van Gogh' :-)
> 

Thats a FAQ (not in this group though) ...

/J\
-- 
"Buzz Aldrin was the second man to walk on the moon and the first to
fill his pants" - Violet Berlin, The Big Bang


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

Date: 27 Jun 1999 18:33:28 GMT
From: "K. Posern" <posern@informatik.uni-marburg.de>
Subject: pipes !!! ???
Message-Id: <37766E46.F5A4C919@informatik.uni-marburg.de>

Hi.

I would like to have a perl script that LISTENS
ALL THE TIME to the
syslogd-messages in /var/log/messages.
((because I need to exctract a database-file
out of the ISDN related
entries...)

O.k. so I decided to build a script, that
listens to the STDIN in an
never-ending-loop, like this:

while (<STDIN>) {

    ## watch the input here...

}

And I call the script with the following
command-line:

tail -f /var/log/messages | myScript.pl &

That would be fine, if there is not the
CRON-job which zipps the
messages file if it is bigger than 4MB.
And I don't want to disable this, because
otherwise the harddisc would
be out of space quite fast...

BUT if cron zipps the messages-file the tail -f
doesnt recognize this
and goes on listening, which is fatal, because
the newly created
messages-file  is NOT "send to" the tail -f...
so "myScript.pl" just
gets stuck this way everytime the messages file
is zipped.

WHAT CAN I DO? - expect to change the
cron.daily - shell-script to
restart "myScript.pl" everytime
/var/log/messages is zipped - or is this
the ONLY solution? - I can't believe this....

 ....but I don't know any other solution at the
moment...

It would be GREAT (!!!) if someone could sent
me a hint on this.

Ciao,

Knuth.







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

Date: 29 Jun 1999 13:50:14 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: pipes !!! ???
Message-Id: <7laium$48r$1@lublin.zrz.tu-berlin.de>

K. Posern <posern@informatik.uni-marburg.de> wrote in comp.lang.perl.misc:
>Hi.
>
>I would like to have a perl script that LISTENS
>ALL THE TIME to the
>syslogd-messages in /var/log/messages.

[...]

>And I call the script with the following
>command-line:
>
>tail -f /var/log/messages | myScript.pl &
>
>That would be fine, if there is not the
>CRON-job which zipps the
>messages file if it is bigger than 4MB.

[...]

>WHAT CAN I DO? - expect to change the
>cron.daily - shell-script to
>restart "myScript.pl" everytime
>/var/log/messages is zipped - or is this
>the ONLY solution? - I can't believe this....

Well, with this setup there doesn't seem to be much you can do, since
it's the process running tail -f that loses connection, not your
process.  Anyway, what's wrong with restarting your pipeline a couple
of times per week -- or even per day?

You could, of course, read directly from /var/log/messages (see
Tom C's Cookbook, recipe 8.18 for how to emulate tail -f behavior).
Still, much depends on what exactly happens when the messages file
is "zipped".  You might want to stat the file (not the handle you've
got) periodically and see if its size has shrunk.  Anyway, this
leads quickly out of topicality for this group and would be better
discussed in a unix ng.

Anno


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

Date: 29 Jun 1999 11:51:13 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Proxy with Perl
Message-Id: <7labvh$3tu$1@lublin.zrz.tu-berlin.de>

 <stuckenbrock@my-deja.com> wrote in comp.lang.perl.misc:
>Hello there,
>
>I4m trying to write a generic TCP-Proxy in Perl. I thought about
>different ways, but I think the easiest is to do a fork, and then have
>one Process writing from the Server to the client and the other from the
>Client to the Server.

Does that mean you do two forks, one for each direction?  That would
leave the initial process free to accept more connections.

>Now I have the problem that I don4t know how to close the connection to
>one end if the other has disconnected. For example:
>I4m proxying a POP3 session and the client sends a QUIT to the Server
>(it sends it to my proxy, which sends it to the Server). The Server
>disconnects from the proxy (for him the proxy is the client). Now I want
>the proxy to disconnect the client, but it doesn4t. Here4s the code:
>
>      if ($kidpid) {
>         # send Data from Server to Client
>         while (defined ($line = <$local_serverside>)) {
>#            print STDOUT $line;
>            print $local_clientside $line;
>         }
>         $local_serverside->close;
>         $local_clientside->close;
>         kill("TERM", $kidpid);                  # sen

Probably another process still has an open filehandle for one of
the sockets.  In general, in this type of program, let every process
immediately close all socket related filehandles it doesn't use.

Anno


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

Date: 29 Jun 1999 12:18:47 GMT
From: guest2@solnce.fe.uni-lj.si (Marek Andricik)
Subject: Re: shortest self printing perl program
Message-Id: <7ladj7$o3q$1@news.uni-lj.si>

John Porter (jdporter@min.net) wrote:
: In article <87iu8vd1no.fsf@gate7.olympiakos.com>,
:   Kiriakos Georgiou <kgnews@olympiakos.com> wrote:
: >
: > printf($x,39,$x='printf($x,39,$x=%c%s%c,39);',39);
: Whoa, you *are* a guru.  I genuflect in your general direction.

:   seek DATA,0,0;print<DATA>;
:   __DATA__

: Isn't this a FAQ by now?

Hmm...

  1. Trainling semicolon could be omitted.
  2. What about __END__ instead of __DATA__?

So, it's bit shorter, isn't it?  ;o)

163 solnce /..uest2/works/derpi/ma % perl s1
seek DATA,0,0;print<DATA>
__END__
164 solnce /..uest2/works/derpi/ma % cat s1
seek DATA,0,0;print<DATA>
__END__
165 solnce /..uest2/works/derpi/ma %

eM
--
  ,:||:,:||:,          Marek Andricik, IRC Nevedko, postgraduate student, pgp
+:||<>||:><||:-    andricik@oko.fei.tuke.sk, http://oko.fei.tuke.sk/~andricik
  ':||:':||:'  ......and.It's.Your.Face.I'm.Looking.For.On.Every.Street......
                                                              [OnEveryStreet]



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

Date: Tue, 29 Jun 1999 11:00:34 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: Alberto <figarema@my-deja.com>
Subject: Re: Special Charecters converted from forms
Message-Id: <siyah39sq5.fsf@cre.canon.co.uk>

Alberto <figarema@my-deja.com> wrote:
> In Spanish we use certain non-standard charecters, in HTML they are
> represented as:
>     &aacute; &eacute; &iacute; same for o and u.
>     Also the &ntilde; and the inverted question mark.
> The script does not seem process them well, to convert them back from
> the coding.

>From the documentation for HTML::Entities:

     decode_entities($string)
         This routine replaces HTML entities found in the $string
         with the corresponding ISO-8859/1 character.
         Unrecognized entities are left alone.

HTML::Entities (by Gisle Aas) is distributed with the LWP toolkit
(http://www.cpan.org/modules/by-module/LWP/libwww-perl-5.44.tar.gz).

-- 
Gareth Rees


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

Date: 29 Jun 1999 13:01:15 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Using Perl with an ADVFS filesystem...
Message-Id: <7lag2s$ij7$1@coranto.ucs.mun.ca>

 [ Courtesy CC ]

In comp.lang.perl.misc Lindsay Feuling <feuling@gcg.com> wrote:
>> I am wondering if anyone in Perl-land has used their Perl code for
>> file I/O on the Digital UNIX (Tru64, <-- insert newest OS name here)
>> advfs (Advanced File System, great name, huh?) filesystem. And, if so,
>> were there any problems with file I/O?

The only Perl-specific caveat with filesystems I can think of is
"perl -i".  The "-i" means "in-place", but that's misleading.
As noted in perlrun and detailed further in perlfaq5, when you run
"perl -i.ext ... file", you create a new file.  As a result, the
permissions on the directory affect your ability to use the
feature; and the new file's permissions are determined by your
current environment: the permissions of the original file will not
(necessarily) be duplicated.  See the man pages for details.

The only additional caveat for filesystems is that D Unix has
Access Control Lists (ACLs) as well as the usual Unix filesystem
permissions.  If you want to keep the same functional access
for the new file, check ACLs as well as file permissions.

Of course, this is a factor for any filesystem with ACLs, not
simply AdvFS.  It should also be clear that other filters and
utilities may also have problems with ACLs.  For example, an RCS
(as supplied with D Unix) will not preserve the ACL for a file.
BBC's EDT also does the rename/create new file; though it
maintains file permissions, it does not (under BBC101) know to
check for ACLs.

Additionally, your ability to query or modify ACLs across NFS
is subject to implementation.  You probably won't be able to
see the ACLs across NFS, even if they are enforced.

Paul Fardy
-- 
Paul David Fardy                      |  pdf@morgan.ucs.mun.ca
Computing and Communications          |  pdf@InfoNET.st-johns.nf.ca
Memorial University of Newfoundland   |
St. John's, NF  A1C 5S7               |


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

Date: 29 Jun 1999 05:48:31 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Viral matters [completely off-topic]
Message-Id: <3778b28f@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    pijll@phys.uu.nl (Eugene van der Pijll) writes:
:http://www.perseus.tufts.edu/cgi-bin/text?lookup=ag+gram.+48

:The authors of this page claim that of the four neuter words of the second
:declension ending in -us (virus, pelagus, vulgus and cetus) two have a
:plural with -e, apparently coming from Greek: pelage and cete. 

Very good catch!  Added to the 

    http://language.perl.com/misc/virus.html

page.

thanks!

--tom
-- 
    "Winter is worth its wait in cold." --Larry Wall


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

Date: Tue, 29 Jun 1999 14:48:10 +0200
From: Riccardo Gubser <riccardo.gubser@ubs.com>
Subject: Week Number without Date Module?
Message-Id: <3778C08A.31474A59@ubs.com>

hiya there

i have to create a folder for each week number. Yeah i know should be no
problem with the Date::Calc Function, but we don't have it and we can't
install it beceause of the sysad.

is there any other function or method to find out which week number we
have.


tx
Ricc


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

Date: Tue, 29 Jun 1999 13:36:54 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Week Number without Date Module?
Message-Id: <3779c918.22971497@news.demon.co.uk>

On Tue, 29 Jun 1999 14:48:10 +0200, Riccardo Gubser
<riccardo.gubser@ubs.com> wrote:

>hiya there
>
>i have to create a folder for each week number. Yeah i know should be no
>problem with the Date::Calc Function, but we don't have it and we can't
>install it beceause of the sysad.
>
>is there any other function or method to find out which week number we
>have.

Of course, it all depends on what your definition of a week number is,
but you can get both the year day and week day numbers from localtime
and I'd suspect you can calculate it from those.

hth,

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: Tue, 29 Jun 1999 13:17:27 GMT
From: Kenneth Massey <kmassey@mratings.com>
Subject: win32 file access
Message-Id: <3778C91F.C0320355@mratings.com>

I am writing a CGI script that will run on a NT server.  It needs to
access a data file of name/email addresses (sometimes reading, sometimes
writing).  How can I lock the file so that simultaneous accesses don't
mess things up?  

I've tried flock(), but the experiments I've tried indicate that the
file can still be accessed by multiple people at the same time.  Any
ideas would be great.  Thanks,

Kenneth


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

Date: Tue, 29 Jun 1999 15:19:31 +0200
From: Burkhard Kiesel <burkhard.kiesel@med.siemens.de>
Subject: WIN32:OLE - Excel
Message-Id: <3778C7E3.35966A60@med.siemens.de>

Hi,

I wrote a Perl-Script which inserts some values into several Excel
Sheets. After that, I defined a Chart-Diagram, with a specified region.
How can I access the region definition in Excel. If I select the Region
(Datasource) in Excel, I get the value
( =Werte!$A$1:$A$334;Werte!$H$1:$H$334 ). How can I retrieve this value
within WIN32::OLE ?

Burkhard



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

Date: Tue, 29 Jun 1999 12:33:34 GMT
From: Albrecht Schmidt <albrecht@cwi.nl>
Subject: yacc like tool
Message-Id: <si4u2rr89up.fsf@kameel.cwi.nl>


Hi,

I wonder whether there is a yacc like tool for perl which supports
parsing against grammar rules.  I am implementing a little language on
top of perl and currently have to rely on the built-in matching
operations but they tend to make my quite code complex as the language
grows.  So it would be nice to have a tool which allows a more
declarative specification of the grammar.

Any help and pointer greatly appreciated.

Al.



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

Date: Tue, 29 Jun 1999 12:49:23 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: Albrecht Schmidt <albrecht@cwi.nl>
Subject: Re: yacc like tool
Message-Id: <siso7b9nos.fsf@cre.canon.co.uk>

Albrecht Schmidt <albrecht@cwi.nl> wrote:
> I wonder whether there is a yacc like tool for perl which supports
> parsing against grammar rules.

The following CPAN modules may be useful:

   Parse::Lex.pm (Philippe Verdret)
   Object-oriented generator of lexical analyzers
   http://www.cpan.org/modules/by-module/Parse/ParseLex-2.10.tar.gz

   Parse::Yapp (Francois Desarmenien)
   Compiles yacc-like LALR grammars to generate Perl OO parser modules.
   http://www.cpan.org/modules/by-module/Parse/Parse-Yapp-0.31.tar.gz

   Parse::RecDescent (Damian Conway)
   Generate recursive-descent parsers
   http://www.cpan.org/modules/by-module/Parse/Parse-RecDescent-1.65.tar.gz

> I am implementing a little language on top of perl

Why reinvent the wheel?  The simplest solution is to use Perl itself as
the scripting language for your application, for you already have an
interpreter -- `eval'.  If security is an issue, use the `Safe' module
to control evaluation.

-- 
Gareth Rees


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 6163
**************************************

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