[8085] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1703 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 22 14:07:55 1998

Date: Thu, 22 Jan 98 11:00:48 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 22 Jan 1998     Volume: 8 Number: 1703

Today's topics:
        ? random text string <lkl@runge.uni-c.dk>
        @ == @, comparing arrays <steves@wco.com>
    Re: CGI to CGI?? <Jacqui.Caren@ig.co.uk>
    Re: CLS in Perl??? <jdporter@min.net>
    Re: command line wildcards <nospam.shardy@activevoice.com>
    Re: converting string to function reference <rootbeer@teleport.com>
    Re: DMS1100 and perl? <Jacqui.Caren@ig.co.uk>
    Re: DOS: command line wildcards (Jonathan Stowe)
    Re: Dynamic web site using PERL - is this possible? <jdporter@min.net>
    Re: fractional second sleep using select broken on NT? <jay@rgrs.com>
    Re: Getting the first two chars of a string - URGENT! (Michael Budash)
        How does perl do "tail -n" ? (Michael Wang)
    Re: How to do random pornography in Perl. <jdporter@min.net>
    Re: HTML to MAIL (Michael Budash)
    Re: I am still a virgin (Michael Budash)
    Re: I need money [Re: I need a script] <jdporter@min.net>
    Re: Im new to perl. <rootbeer@teleport.com>
        isNumeric sub (was: Re: IsDate and IsNumeric available? <rootbeer@teleport.com>
    Re: Multi-computer execution tool/controller for long p <Jacqui.Caren@ig.co.uk>
    Re: mymy revisited <rootbeer@teleport.com>
    Re: Netscape vs. MSIE and Perl script <rootbeer@teleport.com>
    Re: Newbie question <jdporter@min.net>
        OraPerl install (Jordan Redner)
    Re: Parsing HTML tag parameters ("warn unpack 'u*','5<V%M=65L;$!C:7,N=6%B+F5D=0T*';")
    Re: Parsing HTML tag parameters (Abigail)
    Re: PERL programmer needed. <Jacqui.Caren@ig.co.uk>
    Re: Perl programming with NT4.0: sendmail problem <Jacqui.Caren@ig.co.uk>
    Re: PERL Rookie Problem (Jonathan Stowe)
    Re: perl to delete Unix accts (Jonathan Stowe)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 22 Jan 1998 19:28:30 +0100
From: "Lars Kr. Lundin" <lkl@runge.uni-c.dk>
Subject: ? random text string
Message-Id: <34C78FCE.2781@runge.uni-c.dk>

Can anybody tell me how to produce a random text string that matches
/^\w{8}$/ ?

I would be surprised if it is difficult...

Thanks,
Lars.
-- 
M.Sc. Lars Kr. Lundin.                           | Problems worthy
IMM, Technical University of Denmark.            |  of attack
Phone (Office) +45 4525 3079, Fax +45 4593 2373. | prove their worth
E-mail: lkl@runge.uni-c.dk			 |  by hitting back
URL: http://www.imm.dtu.dk/~lkl/                 |       -Piet Hein

Currently stationed at:
    Department of Computer Science
    University of Minnesota
    6-210 EE/CS Building
    200 Union Street SE
    Minneapolis, MN 55455
    USA
    Phone: +1 612 626 0071
    Fax:   +1 612 625 0572


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

Date: Thu, 22 Jan 1998 10:40:54 -0800
From: Steven Smith <steves@wco.com>
Subject: @ == @, comparing arrays
Message-Id: <34C792B6.21A7@wco.com>

I had assumed that @a1 == @a2 would compare two arrays and
tell me if they were the same.  It doesn't and that makes
sense to me -- we're taking the arrays into scalar context
and comparing the number of elements in each group, right?

Is there an easy way to tell if all elements of the array
are the same short of a short subroutine?

Thanks
Steve Smith
DSC Communications
Petaluma, CA.


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

Date: Thu, 22 Jan 1998 13:45:45 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: CGI to CGI??
Message-Id: <En6u8A.9no@ig.co.uk>

In article <01bd1d20$317fcce0$153ff5cc@matt>,
Matt Bieber <mattdb@syntrillium.com> wrote:
>Can anyone tell me if it's possible to call a perl cgi script from within a
>cgi script? I have a machine which has a script that is processing form
>contents which then need to be emailed. Sendmail, however, resides on our
>second machine so it cannot be invoked from within the form processing
>script (or can it?). I figure I could send the form contents to a cgi
>script on the sendmail machine which would then mail it. Incidently, the

try installing and using Net::SMTP (libnet)

or if you want a higher level  "fun to be with" interface try

Mail::Internet

If this is an internet application you could even directly route mail to
your ISP's mailgate reducing load on your sendmail.

Jacqui
-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: Thu, 22 Jan 1998 12:17:42 -0500
From: John Porter <jdporter@min.net>
Subject: Re: CLS in Perl???
Message-Id: <34C77F36.26CB@min.net>

Daivd Mohorn wrote:
> 
> Does Perl-5 have a Clear Screen function or the like?  I'm trying to
> display a menu and have to use a bunch of linefeeds to clear screen
> right now....

Considering that Perl doesn't even have a screen [object], how
could it have a clear [method]?

You need to know what kind of (virtual)hardware device your output
stream is connected to.  Even just using carriage returns and
linefeeds, you're making assumptions (perhaps valid) about your
output device.

It is also critically important to remember that the output from a 
Perl program might not be going to an interactive device at all;
it might be redirected (piped) into the input of another program,
or into a file.  Your program ought to be able to recognize and
handle these situations.  For starters, look at the Curses module.

hth,
John Porter


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

Date: Thu, 22 Jan 1998 09:49:31 -0800
From: "steve hardy" <nospam.shardy@activevoice.com>
Subject: Re: command line wildcards
Message-Id: <6a80up$lhl@news9.noc.netcom.net>

in dos, something like the following ought to work from the commandline:

for %a in (*.dat) do perl -n test.pl %a

hth.

steve

Brendan Macmillan wrote in message
<6a7cfb$8ce$1@towncrier.cc.monash.edu.au>...
>Hi,
>
>I'm new to perl - finally upgrading from awk! Running: Perl, version 4.0;
DOS
>After looking through the WCS text, and attempting to get the FAQ, I now
>turn to you, dear (news) reader-
>
>
>I want to say something like:
> perl -n test.pl *.dat
>
>but the wildcard does not seem to be expanded into all the matching





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

Date: Thu, 22 Jan 1998 10:04:18 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Alex Khesin <khesin@staff.juno.com>
Subject: Re: converting string to function reference
Message-Id: <Pine.GSO.3.96.980122095838.20494b-100000@user2.teleport.com>

On Tue, 20 Jan 1998, Alex Khesin wrote:

> I have a string variable with function name in it, and I need to create a
> variable containing a reference to this function, i.e.
> 
>     sub foo {}
> 
>     $a = "foo";
>     ... some magic to make $aref refer to whatever $a names (&foo in this
> example)
>     &$aref;

There's some danger in doing this with soft references, if the string
might ever be set from user input. 

I'd recommend that you check out Randal's eighth Unix Review column, which
uses code refs to make an op table.

    http://www.stonehenge.com/merlyn/UnixReview/

But if you must get a ref to the sub named in $var, try this code.

    $var = "foo";
    {
	no strict 'refs';
	$aref = \&$var;
    }

You should be aware that this could give you a reference to a sub which
doesn't exist, though... :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 22 Jan 1998 14:27:11 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: DMS1100 and perl?
Message-Id: <En6w5C.9vC@ig.co.uk>

In article <Pine.GSO.3.96.980115081253.5044G-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@teleport.com> wrote:
>On Wed, 14 Jan 1998, Franklin L. Petersen wrote:
>
>> Is it possible to access a DMS1100 database via perl?
>
>I'm sure it's possible. If there's a module, it might even be easy. If
>there's a module which does what you want, it should be listed in the
>module list on CPAN. If you don't find one to your liking, you're welcome
>and encouraged to submit one! :-)  Hope this helps! 
>
>    http://www.perl.org/CPAN/
>    http://www.perl.com/CPAN/

Also look at the DBI web site.

http://www.hermetica.com/technologia/DBI/

-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: 22 Jan 1998 18:49:39 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: DOS: command line wildcards
Message-Id: <6a84c3$7j7$4@uranium.btinternet.com>

In article <6a7cfb$8ce$1@towncrier.cc.monash.edu.au>, 
bren@fangorn.cs.monash.edu.au says...
>
>Hi,
>
>I'm new to perl - finally upgrading from awk! Running: Perl, version 4.0; 
DOS
>After looking through the WCS text, and attempting to get the FAQ, I now
>turn to you, dear (news) reader-
>
>
>I want to say something like:
>        perl -n test.pl *.dat
>
>but the wildcard does not seem to be expanded into all the matching
>filenames! This is a fundamental feature of tools like grep and awk -
>how do I get perl to do it?
>
>I tried
>        while (<*>) {print;}
>as a test example, and it doesn't seem to work either. (Also, a few other
>glob() tests...)
>
>

Now if you were using a 5.* perl I would recommend the File::Dosglob module
that I use - If you are using dos under windows (3.1*) then you can get 
the djgpp version, infact you could get a version of bash and a whole load
of ports of gnu stuff.

Most archives will have this stuff or just search for "djgpp".

/J\



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

Date: Thu, 22 Jan 1998 13:20:20 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Dynamic web site using PERL - is this possible?
Message-Id: <34C78DE4.354D@min.net>

InsideTheWeb wrote:
> 
> I hope this isn't all to confusing. I'm thinking
> that there must be some way to accomplish this with
> PERL. I'm hoping that someone here could do it, or could
> recommend someone who can.

Sure it's possible with Perl.  This is why so many people
use Perl to power their web sites!

Do you know how to program in Perl?  Do you know how CGI
works?  If the answer to either question is "No", then now
is the best time to learn.  Of course, there are solutions
that don't require CGI, and there are some that don't
require Perl.  But Perl+CGI is a combination that is easy
to learn and easy to do in the real world.

What platform are you running on? And what web server software
are you using?

John Porter

Btw: you have a typo:
http://www.detailsfree.com/autclub/contact.html
should have been
http://www.detailsfree.com/autoclub/contact.html


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

Date: 22 Jan 1998 13:33:15 -0500
From: Jay Rogers <jay@rgrs.com>
Subject: Re: fractional second sleep using select broken on NT?
Message-Id: <82pvlkick4.fsf@shell2.shore.net>

Jason Moore <junk@sober.com> writes:
> I'm finding perlfunc manpage for getting a millisecond sleep using
> select doesn't work on NT (5.004_01).  Anyone know of a workaround to
> get a 0.1 second sleep?
> 
> Here's my test:
> 
> perl -e "select(undef, undef, undef, 10)"
> 
> [returns almost instantly.  As does:]

The persnickety NT implementation of select() seems to require
at least one argument containing a valid bit mask.

One workaround is to create a socket just for that purpose
(i.e. create the socket but don't try to connect).

This example creates a spinning symbol:

    use Socket qw(AF_INET SOCK_STREAM);
    socket(TIMER, AF_INET, SOCK_STREAM, 0)
        or die $!;
    
    $timeout = 0.05;
    @sym = qw(\ | / -);
    vec($rin='', fileno(TIMER), 1) = 1;
    
    while (1) {
        select($rout=$rin, '', '', $timeout);
        print "\b$sym[$i++]";
        if ($i > $#sym) {
            $i = 0;
        }
    }
    
    close TIMER;

--
Jay Rogers
jay@rgrs.com


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

Date: Thu, 22 Jan 1998 09:15:14 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Getting the first two chars of a string - URGENT!
Message-Id: <mbudash-2201980915140001@d135.pm4.sonic.net>

In article <comdog-ya02408000R2101982334380001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

>> In article <mbudash-2101981928290001@d126.pm3.sonic.net>,
mbudash@sonic.net (Michael Budash) posted:
>> 
>> >In article <34BF285E.7E7E@nortel.ca>, Ben Holness <bholness@nortel.ca>
wrote:
>> >
>> 
>> >>> I would like to be able to get just the first two chars of the string,
>> >>> ie "4R" or "Q6" (as in the examples above).
>> 
>> >$out = substr($in, 0, ($no_of_chars_to_leave - length($in)));
>> 
>> i'm not sure about the rational for the expression in the 
>> LENGTH part above, but if you want just the first two characters
>> one needn't do so much work:
>> 
>>    print 'just another ' . substr('NY.pm', 0, 2) . ' perl hacker';
>> 

shhhhh, brian - it was such an easy question, i just had to come up with
an answer that looked complicated! (it actually _is_ an alternative - but
you know that) let me have my fun...

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: 22 Jan 1998 17:33:10 GMT
From: mwang@alhena.ibk.ml.com (Michael Wang)
Subject: How does perl do "tail -n" ?
Message-Id: <6a7vsm$a58$1@news.ml.com>

How do you perl scriptors do the following? 

#/bin/ksh
$ if [[ $(wc -l file) > 1000 ]] && {
$   a=$(tail -100 file)
$   print -r "$a" > file
$ }

I need to control the size of a file within 1000 lines.
Thanks.


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

Date: Thu, 22 Jan 1998 12:32:24 -0500
From: John Porter <jdporter@min.net>
Subject: Re: How to do random pornography in Perl.
Message-Id: <34C782A8.6818@min.net>

> Fred Tunalu wrote:
> 
> > Need random pornography in Perl?

I admit, writing Perl code turns me on, and the standard
implementation of rand() is obscene, but...


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

Date: Thu, 22 Jan 1998 09:18:44 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: HTML to MAIL
Message-Id: <mbudash-2201980918450001@d135.pm4.sonic.net>

In article <01bd26ac$6e0602c0$825f04d1@dos>, "S Newberg"
<kid@actioninternet.net> wrote:

>> I am having some trouble with a lil perl script that sends contents from an
>> HTML input, but I can't seem to get it to mail those contents. I can get it
>> to mail, but the origonall contents I read in never show. 
>> 
>> I am a novice perl programmer and appreciate any suggestions. The output at
>> the bottom is definately what I am doing wrong. I found the script and
>> fixed many bugs, but can't get the origonall %input to be outputed to the
>> message body of the Email message. 
>> 
>> 
>> ####Snipped------------------

er, some reason you're not just using sendmail? are you not on some kinda
unix? perhaps you want "more control"?

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Thu, 22 Jan 1998 09:10:52 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: I am still a virgin
Message-Id: <mbudash-2201980910530001@d135.pm4.sonic.net>

In article <34C22707.304E3D13@hotmail.com>, Kati <katigaebler@hotmail.com>
wrote:

[snip] 
>> I do the chmod a+x test.pl, then
>> type test.pl and the shell returns
>> correctly "This is my first test".
>> 
>> But when I access the same file 
>> via Netscape browser, the phrase 
>> is not printed, the above file 
>> is shown in full as ASCII characters. 
>> 

since you did the chmod, it's gotta be a server config thing.

if it's not in a cgi-whatever dir, try renaming it to .cgi (instead of
 .pl). some servers i've seen are not set up to execute script outside of a
cgi dir nless they're named .cgi.

if it _is_ in a cgi- dir, then it should work. contact your server's admin.

hth -

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Thu, 22 Jan 1998 13:29:47 -0500
From: John Porter <jdporter@min.net>
Subject: Re: I need money [Re: I need a script]
Message-Id: <34C7901B.147C@min.net>

Jacqui Caren wrote:
> 
> In article <884055470.317915@cabal>,
> ? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au> wrote:
> >Interesting fact,  you can get any multipal of 10 greater then 70 by the
> >combernations of $20 and $50.
> 
> Why 70?
> I assume you mean +/- combination?
> 
> >For extra points prove the above by use of indution.
> 
> Why - won't any even and odd number (sharing a common even multiple) do just as
> well?

This has already been sufficiently answered in this thread.

In <qz$9801031423@qz.little-neck.ny.us>, Eli the Bearded <*@qz.to>
wrote:
>
> With those units you can hit every non-negative integer
> multiple of ten except for $10 and $30.

Which is to say, $20, and every multiple of $10 >= $40.

John Porter


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

Date: Thu, 22 Jan 1998 09:56:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jason Vallery <vallery@bvsd.k12.co.us>
Subject: Re: Im new to perl.
Message-Id: <Pine.GSO.3.96.980122095509.20494a-100000@user2.teleport.com>

On Tue, 20 Jan 1998, Jason Vallery wrote:

> Subject: Im new to perl.

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

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

> Im looking for a way to take the standard unix dictionary and have perl
> chose a random entry. I want the word into a varible so that I may use
> that as output. Thanks..

Use readdir and rand, and probably some of the other functions in the
perlfunc manpage. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 22 Jan 1998 09:42:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gary Trachier <trachier@crrel.usace.army.mil>
Subject: isNumeric sub (was: Re: IsDate and IsNumeric available?)
Message-Id: <Pine.GSO.3.96.980122092843.20494W-100000@user2.teleport.com>

On 20 Jan 1998, Gary Trachier wrote:

> Here is how I solved the isNumeric problem. 

> sub isNumeric {
>     my      $lookAtThis = shift;
>     local   $isNumeric::warnMsg = '';
> 
> #   print STDOUT "[isNumeric] parameter = \"$lookAtThis\"\n";
>     
>     $SIG {'__WARN__'} = sub {       # set up our own warnings handler

It would be kinder to use local() here, rather than to munge whatever
handler was installed by the sub's caller.

>         $isNumeric::warnMsg = shift;
> #       print STDOUT "Doing Warning.\n";
>     };

It looks to me as if you could have used a my() variable there, rather
than a global in the isNumeric package. To me, a my() variable would be
preferable. (This would be a kind of closure, as I've shown below.) 

>     $lookAtThis += 0.0;             # try it in a numeric expression

You aren't assuming that warnings are enabled, are you? :-)

>     delete $SIG {'__WARN__'};       # restore the default warnings handler
>     
>     if ($isNumeric::warnMsg) {
> #       print STDOUT "Fail\n";
>         return (0);                 # failed, non-numeric;
>     }
>     else {
> #       print STDOUT "Pass\n";
>         return (1);                 # passed, is numeric
>     }
> }

Rather than printing a message within the sub, wouldn't it be nicer to let
the caller do that? Here's my implementation of your test algorithm.

    sub isNumeric ($) {
	my $warning = '';
	local($SIG{'__WARN__'}) = sub {
	    $warning .= $_[0];
	};
	local($^W) = 1;		# turn on warnings
	(undef) = 0+$_[0];	# Does Perl think it's a number?
	return scalar ($warning !~ /isn't numeric/);
    }

It's not bad in some ways, but I hate having to assume anything about
warning messages. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 22 Jan 1998 14:04:26 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Multi-computer execution tool/controller for long processes
Message-Id: <En6v3E.9qr@ig.co.uk>

In article <d1zycl9nm.fsf@elmo.s3i.com>, Clark Dorman  <clark@s3i.com> wrote:
>
>Greetings,
>
>I asked about this once before, but now I'm trying again.  I need to
>run several hundred iterations of a large, complex model (runtime ~2
>hours, several system calls: initialize, run, process results).  I
>have access to a number (about 8) 4-cpu workstations and a couple of
>8-cpu workstations.  What I need to do is monitor the cpu usage of the
>workstations, launch jobs when cpu's are available, and report to the
>user how things are going.  I have a solution, but it's not a very
>good one.  I have an idea for a better one, but I'm not sure about how
>to make it work.

Have you considered using a off-the shelf job/process scheduler/moditor.

There are some rather cute tools available these days - you are no longer
stuck with NQS these days.

i.e. Have a look for DQS.

Jacqui
-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: Thu, 22 Jan 1998 10:38:37 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Yary <yary@apicom.com>
Subject: Re: mymy revisited
Message-Id: <Pine.GSO.3.96.980122103510.20494d-100000@user2.teleport.com>

On Tue, 20 Jan 1998, Yary wrote:

> Now, I suppose this is impossible, but is there some prototype, or some
> other hack, to have
> 
> my_uberthing @a, @b;
> my_uberthing %a, %b;
> 
> call "my_uberthing" with references to the two arguments?

If I understand your request, no. But if you ignore prototypes and pass
the args by reference, it's possible for the caller to see whether you're
passing arrayrefs or hashrefs.

> And, restating my original more general question, is it possible to
> create a
> 
> sub mymy ....
> 
> such that calling
> 
> mymy @a, %b, FILEHANDLE_C, $d, *e ....
> 
> gives mymy references to all those arguments?

You want each and every arg to be turned into references? There's no proto
to do that. But that's what the backslash key is for. :-)

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 22 Jan 1998 09:53:40 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Bruce A. Head" <bahead@interlog.com>
Subject: Re: Netscape vs. MSIE and Perl script
Message-Id: <Pine.GSO.3.96.980122095029.20494Z-100000@user2.teleport.com>

On Tue, 20 Jan 1998, Bruce A. Head wrote:

> I'm not sure whether this is a Perl question or a CGI question (or an
> HTTP question!) but I've also posted it in
> comp.infosystems.www.authoring.cgi

In general, it's better to crosspost than to post a message multiple
times. Of course, you should post it to only the appropriate group or
groups in any case. 

> While this works fine in Netscape 3.0, it does not work in
> Internet Explorer 4.0.  

That makes it simple: If you're following the specifications, then it's a
bug in IE4. If you're not, then it's a bug in your script. If you're not
sure, after having read the specs, you should post to a newsgroup about
HTTP (or whatever). Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 22 Jan 1998 13:05:39 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Newbie question
Message-Id: <34C78A73.7E8C@min.net>

Chipmunk wrote:
> 
> [posted and mailed]
> 
> Eyal wrote:
> >
> > I have some pure virtual functions in my C++ header file.
> > i want to use perl to find their name.
> > e.g  if  have this:
> > virtual void coordButtonClicked(Widget, XtPointer, XtPointer) = 0;
> > I want as an output :
> > void coordButtonClicked
> 
> perl -ne 'print "$1\n" if /^\s*virtual\s+([^\(\n]+)/' filename
> 
> That will print out everything after '  virtual' and before '(' or
> newline.
> 
> Chipmunk

Yeah, but that finds non-pure virtuals as well as pure ones.
You need to match the '= 0' at the end too.
Try this regex:

/^\bvirtual\b[^;]*=\s*0\s*;/

Of course, this assumes that the entire declaration is on one line, and
that there is no other stuff like comments anywhere on the line.

hth,
John Porter


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

Date: 22 Jan 1998 17:26:37 GMT
From: jordan@webnex.com (Jordan Redner)
Subject: OraPerl install
Message-Id: <6a7vgd$a3t$1@nntp2.ba.best.com>


I am trying to compile and install Oraperl - and am having the following
problems so far...

I am running on Solaris 2.5.5.1, and Perl version 5.004_04

make: Fatal error: dont know how to make target [perlsrc]/uperl.o

I can't find uperl.o anywhere.

Can I substitute uperl.o with perl.o in the Makefile?

Also - if I copy perl.o to uperl.o, then run the make again, 
I get the error:

make: Fatal error: dont know how to make target [perlsrc]/usub/mus

What the heck is this file?

I cant find any mus file related to Perl anywhere?


Any help would be awesome.  I'd really like to get OraPerl working.



Sincerely,



Jordan Redner
jordan@webnex.com






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

Date: Thu, 22 Jan 1998 17:07:07 GMT
From: i@non.org ("warn unpack 'u*','5<V%M=65L;$!C:7,N=6%B+F5D=0T*';")
Subject: Re: Parsing HTML tag parameters
Message-Id: <885487645.28@207.53.5.149>


In article <34C291D6.D4E9F9E2@coos.dartmouth.edu> on Sun, 18 Jan 1998 18:35:51 -0500,
 Chipmunk <rjk@coos.dartmouth.edu> wrote:

> nobody@nowhere wrote:

>> Ben Glazer (ben.glazer@mail.utexas.edu) wrote on 1600 September 1993 in
>> <URL: news:34c092cb.93214615@newshost.cc.utexas.edu>:

>>++ All I want to do is split the parameter list of an HTML tag into an
>>++ array.  So, for example, starting off with input of
>>++
>>++       <img src="pish.gif" alt="hello kitty" width=100>
>>++
>>++ my program sets
>>++
>>++      $params = "src=\"pish.gif\" alt=\"hello kitty\" width=100";
>>++
>>++ which is all well and good.  Now all I want to do is find some way to
>>++ set
>>++
>>++      @params = (
>>++              "src=\"pish.gif\",
>>++              "alt=\"hello kitty\",
>>++              "width=100")

>> Try this:
>>      @params = split(/\s+/, $params);


> Hmm...  I wonder what that would do if there were spaces within the
> quoted parameter arguments.
> As there are in the example provided by the original poster, say.


#!/bin/perl

# If I understand what the original question was,
# then if:

    $tag = '<img src="pish.gif" alt="hello kitty" width=100>';

# then, this seems to do what he wants:

    $tag =~ s/\w+?=(".+?"|\w+)/push @params, $&/ges;

# The 'e' option for substitutions is very handy for this kind of thing.

print join "\n", @params, "\n";

# And in the second part, if he wants to assign the values to
# variables, then this will do that:

    foreach (@params) { eval "\$$_" }

# Obviously, a case for 'eval'.

print "src = $src\nalt = $alt\nwidth = $width\n\n";

# Or if you don't care about preserving \@params:

    eval "\$$_" while $_ = pop @params;

#

print "src = $src\nalt = $alt\nwidth = $width\n";

exit;

__END__



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

Date: 22 Jan 1998 18:45:04 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Parsing HTML tag parameters
Message-Id: <6a843g$hgj$2@client3.news.psi.net>

warn unpack 'u*','5<V%M=65L;$!C:7,N=6%B+F5D=0T*'; (i@non.org) wrote on
1605 September 1993 in <URL: news:885487645.28@207.53.5.149>:
++ 
++ #!/bin/perl
++ 
++ # If I understand what the original question was,
++ # then if:
++ 
++     $tag = '<img src="pish.gif" alt="hello kitty" width=100>';
++ 
++ # then, this seems to do what he wants:
++ 
++     $tag =~ s/\w+?=(".+?"|\w+)/push @params, $&/ges;

Four cases where this fails:

<img src = "fooled you">
<img src=fooled.you>
<img src='fooled you'>
<img src="fooled you" ismap>


Use HTML::Parser saves you lots of problems.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Thu, 22 Jan 1998 14:37:24 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: PERL programmer needed.
Message-Id: <En6wMC.9y5@ig.co.uk>

In article <34BD1AB6.270D142@wynn.com>, Ruben  <ruben@wynn.com> wrote:
><<<Did anyone suggest that they take a full/half page ad in the perl
>journal? This would be a very very good way to get the attention of
>some of the best perl folks. People who take out large ads in TPJ are>>
>
>Or maybe someone is trying to promote TPJ?!

You got it in one! - but not because I work for it but because it is
"The Perl Journal", read by most of the best perl people and is a good
way to target such people with job adverts. If these folks are seriously looking
for competent perl people then TPJ is probably one of the best ways of getting
thier jobs advertised.

FYI: We advertise on the back cover - that is my only relationship with TPJ.

Jacqui

p.s.
Anyone reasonably competent applies a filter to usenet to skip such
unwanted posts I get to see such adverts once - and never see another
posting from that company.

-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: Thu, 22 Jan 1998 12:40:36 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Perl programming with NT4.0: sendmail problem
Message-Id: <En6r7o.9FM@ig.co.uk>

[ newsgroups trimmed ]
In article <884344586.182916@cabal>,
? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au> wrote:
>In <qz$9801081648@qz.little-neck.ny.us> Eli the Bearded <*@qz.to> writes:
>
>[...]
>
>>Isn't POP3 just for reading mail?
>
>Some versons of POP3 allow the posting of mail as well.

Which commands in the POP3 RFCs cover about mail submission?
Do you know of any good POP enabled MUAs that use this and
server side mail folder management?

POP was originally designed as a MS->MUA protocol, and has
some rather nifty extensions to handle MS side mail folders etc
but I have not come across MUA->MS->MTA via POP3.

Perhaps It's time to go and read the RFC's again :-)

Jacqui
-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: 22 Jan 1998 18:44:24 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: PERL Rookie Problem
Message-Id: <6a8428$7j7$3@uranium.btinternet.com>

In article <34C761BB.15E32ABF@nortel.ca>, nemanja@nortel.ca says...
>
>This is a multi-part message in MIME format.
>--------------0D19A576DDB58A6E614C0129
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>HI!
>I have a question for all the perl pros on this group. I intend to use a
>WIN95 PC for compiling (don't laugh, I haven't a UNIX station). I
>downloaded the CGI.pm module, which has (to my chagrin) been tarred and
>gzipped. Apparently, there is a way to extract the module in WIN95, but
>the CPAN page gave me a cold shoulder as far as that is concerned. I'm
>left to my own devices, so, lazy as I am, I figured there are people who
>know how to do this, or who will tell me that I'm a fool to compile perl
>on WIN95.
>Either way, if you know the answer to my problem, please let me know.
>Thanks a bundle.

As well as WinZip you may find that you will need a decent "make" and a 
variety of other utilities to install the module in the "approved" manner.
you can usually frig it up somehow but often the Makefile.PL technique just
dont work on win95 (for me anyhow).

>
>Nemanja (nemanja@nortel.ca)
>
>--------------0D19A576DDB58A6E614C0129
>Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
>Content-Transfer-Encoding: 7bit
>Content-Description: Card for Nemanja Dundjerovic
>Content-Disposition: attachment; filename="vcard.vcf"
>
>begin:          vcard
>fn:             Nemanja Dundjerovic
>n:              Dundjerovic;Nemanja
>org:            Northern Telecom
>adr:            14 Central Park Drive;;;Ottawa;Ontario;K2C 3Z9;Canada
>email;internet: nemanja@nortel.ca
>tel;work:       (613) 724-7025
>x-mozilla-cpt:  ;0
>x-mozilla-html: FALSE
>version:        2.1
>end:            vcard
>
>
>--------------0D19A576DDB58A6E614C0129--
>

Hey great, I wonder how long it will be before the Spammers get wind of this
vcard stuff and start sending follow-up snail-mails ;-{

/J\



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

Date: 22 Jan 1998 18:25:22 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: perl to delete Unix accts
Message-Id: <6a82ui$7j7$1@uranium.btinternet.com>

In article <6a7phv$bpq$1@ug2.plk.af.mil>, rokosz@ug2.plk.af.mil says...
>...
>if ($username =~ /^([-\@\w.]+)$/) {
> $username = $1;
>}
>system "/usr/sbin/userdel -r $username";
>

funnily enough I wrote something doing the same thing earlier today
and it works fine.

This will almost certainly be an OS thing. 

Does the userdel -r <user> work from the command-line. if it does then
it probably is something to do with the necessary permission changes and c.
when /etc/shadow is edited - this file should be readable to no-one except
root for security purposes.

/J\



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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