[17240] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4662 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 19 11:05:32 2000

Date: Thu, 19 Oct 2000 08:05:10 -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: <971967909-v9-i4662@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 19 Oct 2000     Volume: 9 Number: 4662

Today's topics:
        @Arrays as Parameters <stuart.maccallum@wisesystems.co.uk>
    Re: @Arrays as Parameters <anders@wall.alweb.dk>
    Re: @Arrays as Parameters (Bernard El-Hagin)
        activestate install question ?? <mrobison@c802.crane.navy.mil>
    Re: activestate install question ?? (Bernard El-Hagin)
        cgi & frame problem <jukka@qnet.fi.no.spam>
    Re: cgi & frame problem <anders@wall.alweb.dk>
    Re: CGI script problem on Win (Helgi Briem)
    Re: Cookieless operation yossariancomputing@my-deja.com
    Re: Counter doesn't work <mrobison@c802.crane.navy.mil>
        errors xerxes_2k@my-deja.com
    Re: errors <jeffp@crusoe.net>
        File::Find pruning <james@NOSPAM.demon.co.uk>
        How to get rid of '/' in a telnet prompt? chermashentsev@hotmail.com
        Macperl email form script <penny@gbgraphics.com>
    Re: Memory usage : how know ? <anders@wall.alweb.dk>
        newbie intro <mrobison@c802.crane.navy.mil>
        Newbie Question: command line parameters - WIN32 <acheney@my-deja.com>
    Re: Newbie Question: command line parameters - WIN32 <anders@wall.alweb.dk>
    Re: Newbie Question: command line parameters - WIN32 (Martien Verbruggen)
        Problem with array <monte@sorint.it>
    Re: Problem with array <anders@wall.alweb.dk>
    Re: Regex for matching e-mail addresses <andy@NOSPAM.rickham.net>
        Resource Fork Integrity Checks <mac-dev@demon.net>
    Re: Search, pad, replace <n0spam@mail.com>
        using alerts <hi@konstantin-schauwecker.de>
    Re: using alerts <anders@wall.alweb.dk>
    Re: value exchange of two vars <jeffp@crusoe.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 19 Oct 2000 14:50:38 +0100
From: "Stuart MacCallum" <stuart.maccallum@wisesystems.co.uk>
Subject: @Arrays as Parameters
Message-Id: <sutv0h6f6la76f@corp.supernews.com>

Hi.

 I'm relatively still new to Perl, and have a small problem with the eval
function. I'm unsure if what I'm asking is feasible, but I've attempted to
find the answer in the Perl documentation and the web and had no success.

What I want to do is call a perl function named $params[1], and pass the
array @PIDVALS to it.

eval("$params[1](@PIDVALS2)");

 I have changed the array separator ($") to "," so that each item in the
array would be a separate parameter, this does not work.

If $params[1] = "IDCheck" the following function would be called:

    sub IDCheck{
             my @values = @_;

             print "Array 1 : $values[0]\n";
     }

If anybody knows how I can pass the array, any help would be most welcome.

Regards

Stuart




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

Date: Thu, 19 Oct 2000 16:06:14 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: @Arrays as Parameters
Message-Id: <9eDH5.6744$Uy5.225444@news000.worldonline.dk>

Stuart MacCallum wrote:

> Hi.
> 
>  I'm relatively still new to Perl, and have a small problem with the eval
> function. I'm unsure if what I'm asking is feasible, but I've attempted to
> find the answer in the Perl documentation and the web and had no success.
> 
> What I want to do is call a perl function named $params[1], and pass the
> array @PIDVALS to it.
> 
> eval("$params[1](@PIDVALS2)");
> 

the canonical way to do that is

&$var @args

the "&" prefix tells perl that you are dooing a call to a sub.

You should check that $var is the name of a known sub, or do some other 
error handling for that case.


>  I have changed the array separator ($") to "," so that each item in the
> array would be a separate parameter, this does not work.

Uuuh. Think hard before you mess around w/ theese!

> If $params[1] = "IDCheck" the following function would be called:
> 
>     sub IDCheck{
>              my @values = @_;
> 
>              print "Array 1 : $values[0]\n";
>      }
> 
> If anybody knows how I can pass the array, any help would be most welcome.
> 
> Regards
> 
> Stuart
> 
> 


so you get something like this:

# hash where keys are legal values
my %funcs = (
    IDCheck => 1,
    OtherCheck => 1
);

my $func = $params[1]; # easy reading...

&$func (@PIDVALS) if $funcs{$func};

sub IDCheck {
    my @values = @_;
    # process...
    ...
}

sub OtherCheck {
    return join " and ", @_; # :-O
}

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: 19 Oct 2000 14:12:34 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: @Arrays as Parameters
Message-Id: <slrn8uu0ck.28m.bernard.el-hagin@gdndev25.lido-tech>

On Thu, 19 Oct 2000 14:50:38 +0100, Stuart MacCallum
<stuart.maccallum@wisesystems.co.uk> wrote:
>Hi.
>
> I'm relatively still new to Perl, and have a small problem with the eval
>function. I'm unsure if what I'm asking is feasible, but I've attempted to
>find the answer in the Perl documentation and the web and had no success.
>
>What I want to do is call a perl function named $params[1], and pass the
>array @PIDVALS to it.
>
>eval("$params[1](@PIDVALS2)");
>
> I have changed the array separator ($") to "," so that each item in the
>array would be a separate parameter, this does not work.

The $" and $, variables are for printing arrays:

perldoc perlvar

>If $params[1] = "IDCheck" the following function would be called:
>
>    sub IDCheck{
>             my @values = @_;
>
>             print "Array 1 : $values[0]\n";
>     }
>
>If anybody knows how I can pass the array, any help would be most welcome.

------------------
#!/usr/bin/perl -w
use strict;

my @params;

$params[1] = "bla";
my @PIDVALS2 = (1, 2, 3, 4, 5);

my $eval_string = "$params[1](" . (join ",", @PIDVALS2) . ")";

eval $eval_string;

sub bla{
	print @_;
}
-----------------

Result:

12345

Cheers,
Bernard
--
perl -le'
($B,$e,$r,$n,$a,$r,$d)=q=$B$e$r$n$a$r$d==~m;
\$(.);xg;print$B.$e.$r.$n.$a.$r.$d;'


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

Date: Thu, 19 Oct 2000 13:41:01 GMT
From: Miker <mrobison@c802.crane.navy.mil>
Subject: activestate install question ??
Message-Id: <8smtlc$us0$1@nnrp1.deja.com>

hello,

i installed the activestate perl on my NT box and
it works fine.  i installed in on my win98 laptop
and it won't work.

i browsed the docs and it said that win98 wouldn't
install the path.  i checked my NT box and i had
"c:\perl\bin;" as a path.  on my laptop i had
nothing.  i tried duplicating the one on my NT box
but no luck.  i used default install locations on
both boxes.

could somebody tell me what i need to do to make
activestate work on my win98 machine?

thank you, miker


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


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

Date: 19 Oct 2000 13:52:13 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: activestate install question ??
Message-Id: <slrn8utv6e.28m.bernard.el-hagin@gdndev25.lido-tech>

On Thu, 19 Oct 2000 13:41:01 GMT, Miker <mrobison@c802.crane.navy.mil> wrote:
>hello,
>
>i installed the activestate perl on my NT box and
>it works fine.  i installed in on my win98 laptop
>and it won't work.
>
>i browsed the docs and it said that win98 wouldn't
>install the path.  i checked my NT box and i had
>"c:\perl\bin;" as a path.  on my laptop i had
>nothing.  i tried duplicating the one on my NT box
>but no luck.  i used default install locations on
>both boxes.
>
>could somebody tell me what i need to do to make
>activestate work on my win98 machine?

Why don't you just add "c:\perl\bin" to your path in autoexec.bat?

Cheers,
Bernard
--
perl -le'
($B,$e,$r,$n,$a,$r,$d)=q=$B$e$r$n$a$r$d==~m;
\$(.);xg;print$B.$e.$r.$n.$a.$r.$d;'


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

Date: Thu, 19 Oct 2000 13:31:15 GMT
From: Jukka Pakkanen <jukka@qnet.fi.no.spam>
Subject: cgi & frame problem
Message-Id: <39EF06B3.603CF2D0@qnet.fi.no.spam>

I have a form in a framed page, the form calls a script which after some
crunching reloads the page.

Problem is:

print "Location: http://www.qnet.fi\n\n"; 

opens up a new frame inside the old frame. How can I prevent this?  I
guess I need to include the TARGET ="_top" somehow to the call above?

regards, Jukka


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

Date: Thu, 19 Oct 2000 15:35:34 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: cgi & frame problem
Message-Id: <oNCH5.7586$Tq1.260683@news010.worldonline.dk>

Jukka Pakkanen wrote:

> I have a form in a framed page, the form calls a script which after some
> crunching reloads the page.
> 
> Problem is:
> 
> print "Location: http://www.qnet.fi\n\n";
> 
> opens up a new frame inside the old frame. How can I prevent this?  I
> guess I need to include the TARGET ="_top" somehow to the call above?

This is not a perl problem, it's HTML, but what the hack...

your FORM tag should read

<FORM action="mywondefullscript.pl" target="_top">

using CGI oop:

print $query->startform(-action=>'mywonderfullscript.pl', -target=>'_top');


-anders


-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Thu, 19 Oct 2000 13:22:02 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: CGI script problem on Win
Message-Id: <39eef4d0.1917881507@news.itn.is>

On Mon, 16 Oct 2000 18:09:22 -0500, "Mike"
<mab@sycon-design.com> wrote:

>Hi !!
>I am trying to run guestbook CGI script and File upload script on my Web
>server on WIn 98.
>There is no response to the action. I tried perl script.cgi and got the
>following error message :
>"offline mode: enter name=value pairs on standard input).
>Anybody knows what does it mean ?
>
Itīs not an error message.  It is the 
correct and easily understood message
you will seen from any properly written
Perl CGI program when run in offline
mode, ie on the command line.

It wants you to enter name=value 
pairs on standard input.  If you don't
know what name=value pairs and
standard input are you should get a
book and learn.

Regards,
Helgi Briem


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

Date: Thu, 19 Oct 2000 12:07:54 GMT
From: yossariancomputing@my-deja.com
Subject: Re: Cookieless operation
Message-Id: <8smo6o$q46$1@nnrp1.deja.com>

Hi,

Thnx guys for your input.  I've just finished writing a cookieless
Object Oriented Perl CGI shopping cart implementation for my website,
using all of your ideas on the subject....except that I've just read
the reply regarding CGI::Persistent...looks interesting..I'm going to
delve further.

A couple of notes:

Cookies.  I don't agree that the whole controversy is overrated.  It's
a principle thing.  Basically, I like my privacy, and only want things
written to my harddrive when I agree to have them written....not by
stealth.  Besides, some people (including myself) turn them off, so I
wanted an implementation that did not rely upon them. Agreed I could
have tried to use them, and if that failed, gone cookieless, but I
don't see the need.

Security. That was good advice and so I've taken on board the stuff
regarding security and checking IP address and browser.  When items get
added to a cart, I check if it's an existing cart.  If so, I then check
both the connecting browser and it's IP address, and throw out an error
if they don't match the cartid.

Anyway, thnx again for your advice.

Rgds,

Steve H

> Hi,
>
> I want to maintain state within a web application without using
> cookies, as personally I detest the things, and besides, I don't want
> to worry if a user hates them too and thus can't use my application
> because they've turned them off.
>
> So somehow I suppose I need to use a manually created sessionid of
some
> sort.
>
> I'm using perl 5.006 (with libwww-perl), apache, mysql on a FreeBSD
> machine.
>
> Any tips?
>
> Rgds,
>
> Steve H
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

Date: Thu, 19 Oct 2000 14:43:49 GMT
From: Miker <mrobison@c802.crane.navy.mil>
Subject: Re: Counter doesn't work
Message-Id: <8sn1b3$26d$1@nnrp1.deja.com>

i'm gonna love this group!  a bunch of obviously
experienced programmers who can actually disagree
without starting a big flame war.

miker

In article <39EDC4A3.24EB7438@hetnet.nl>,
  Hans Vogel <hansvog@hetnet.nl> wrote:
> Hello There!
> The following CGI code in Perl Does print "1" in gif but doesn't seem
to
> read and
> write the count.dat file. I did a CHMOD 777 on the dat file but it
still
> doesn't work.
> Can anyone tell me what could be wrong?
> Thanx and greetings from Holland,
> Hans.
>
> $count = '/counter/count.dat';
> $base_url = '/counter/';
>
>     open (COUNT, "$count");
>     $counter = <COUNT>;
>     close (COUNT);
>     open (COUNT, ">$count");
>     $counter += 1;
>     print COUNT "$counter";
> # code for image here
>     close (COUNT);
>
>


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


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

Date: Thu, 19 Oct 2000 13:03:00 GMT
From: xerxes_2k@my-deja.com
Subject: errors
Message-Id: <8smrdv$srv$1@nnrp1.deja.com>

i keep getting annoying errors in one of my scripts:

"variable $blah will not stay shared"
"subroutine redefined"

These are strange becuase:
1: i havet redefined any subroutines.
2: i cant find anything different about this script from any of my
others. And ive never had this error before. I am using strict and
always make sure as many variables as possible are local.

I dont understand what is so different about this script. Can anyone
clarify?


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


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

Date: Thu, 19 Oct 2000 09:17:05 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: errors
Message-Id: <Pine.GSO.4.21.0010190916470.25707-100000@crusoe.crusoe.net>

[posted & mailed]

On Oct 19, xerxes_2k@my-deja.com said:

>i keep getting annoying errors in one of my scripts:
>
>"variable $blah will not stay shared"
>"subroutine redefined"
>
>These are strange becuase:
>1: i havet redefined any subroutines.
>2: i cant find anything different about this script from any of my
>others. And ive never had this error before. I am using strict and
>always make sure as many variables as possible are local.

You're defining ONE function INSIDE another.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

Date: Thu, 19 Oct 2000 13:43:53 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: File::Find pruning
Message-Id: <ant191253345fNdQ@oakseed.demon.co.uk>

In article <slrn8usbmc.bj3.tjla@thislove.dyndns.org>, Gwyn Judd wrote:
> 
> That said, File::Find is a lot simpler to use and
> really is the standard way to do these things.

I recently had a task which I thought would be ideal for File::Find
but I was disappointed with it's behaviour in regard to pruning.
I am therefore tempted to write my own recursive routine, but you'll
probably tell me that I'm doing something wrong and that File::Find
will do what I want after all. Here's what I want to do:

I have a hierarchy of newsgroup directories to scan, and below each
group in the structure are further (numbered) directories containing
article files. Also in each group directory is an article index file
called .overview which I want to process in my script. Having processed
the .overview file I want to move on to the next newsgroup without
scanning all the article subdirectories of the current group.

So here's the structure:

comp/lang/perl/misc/.overview      <--- now I want to prune avoiding
                   /00000/00001    <--- all the article files
                         /..etc
                   /00075/..etc
                   /..etc/..etc
comp/lang/python/announce/.overview    <--- now I want to prune again
                         /00000/00001  <--- avoiding the article files
                         /..etc/..etc

However, when I set $File::Find::prune=1 after processing the
 .overview file File::Find does *not* return to the parent directory.
Worse than that, it goes into all the subdirectories of the current
newsgroup taking an age to complete what should be a quick scan.
In desperation I added the following test at the top of my wanted():

$File::Find::prune=1, return if /^\d{5}$/;

This at least means that File::Find does not go into each collection
of articles, but it does still consider all of the subdirectory names
against that test which is still very wasteful and time consuming.
I had a look at the code for File::Find and saw that it resets its
$prune variable for each call to wanted() and takes no action when
the current item is a file. Perhaps it should be possible to set
$File::Find::prune to a number higher than 1 to indicate that it
should prune that many levels off the search tree, thus allowing me
to return to the parent by setting prune to 2.

Do you like the sound of that idea?
Would it break many existing scripts?
Can you suggest a better way to fix File::Find for this purpose?
Is there an existing way to get File::Find to do what I want?
Is there a different and/or better way to do what I want?

Thanks for your help...

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Thu, 19 Oct 2000 14:50:41 GMT
From: chermashentsev@hotmail.com
Subject: How to get rid of '/' in a telnet prompt?
Message-Id: <8sn1nu$2lf$1@nnrp1.deja.com>

I want to connect to a telnet session through the standard Perl
statement: use Net::Telnet ();

In the telnet prompt, I expect a string, something like:

Prompt = > '/2 Enter the OU Code (NNN/NNN):/'

The problem is that my command Prompt=> should receive the string
between the first and the last slashes, but later just a part between
first and second forward slashed are compared. After, execution of the
statement fails.

Any ideas?

Thanks.


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


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

Date: Thu, 19 Oct 2000 14:20:28 GMT
From: Penny Byron <penny@gbgraphics.com>
Subject: Macperl email form script
Message-Id: <B6146C4F.53E6%penny@gbgraphics.com>

Hi, 
I'm a total newbie to scripting. I built a site for a charity using
FormMail.pl on the assurance that their server accepts Perl Script. Now I
find out it only runs MacPerl. I don't really know the difference except
that it doesn't work on their server.

Does anyone know of somewhere that I can download a MacPerl script for
emailing form information?

I built this site for a charity organization and have spent way too much
time on it as is. If anyone can help, it would be appreciated.

Thanks, 
Penny



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

Date: Thu, 19 Oct 2000 12:10:24 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Memory usage : how know ?
Message-Id: <2NzH5.6686$Uy5.222188@news000.worldonline.dk>

Alain BARBET wrote:

> Hi,
> 
> I've trouble with a script that take too ram and get down server. How
> can I see with a module or a unix command, how exactly take my program
> in RAM at one moment ?
> 
> Thanks,
> --
> Alain & Estelle BARBET
> http://www.alianwebserver.com


man top
man ps

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Thu, 19 Oct 2000 14:33:53 GMT
From: Miker <mrobison@c802.crane.navy.mil>
Subject: newbie intro
Message-Id: <8sn0oh$1kb$1@nnrp1.deja.com>



hello,

my name is michael robison and i've been programming
for a long time but i'm new to perl.  i just posted
my first question, about a win98 activestate install,
and i thought it would be nice to also say hello and
introduce myself.  i live in southern indiana.  i've
been tasked to come up to speed on perl and slowly
start building an intranet at the workplace.  i've
got a linux box up and running on the net and i've
got some html and minor scripts running.

this looks like a good group... i notice a decent
amount of posts and not too many unanswered ones.  i
hope that i can come up to speed so that i can
contribute answers to the group instead of just
questions.

miker



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


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

Date: Thu, 19 Oct 2000 11:11:24 GMT
From: Adam <acheney@my-deja.com>
Subject: Newbie Question: command line parameters - WIN32
Message-Id: <8smksp$nup$1@nnrp1.deja.com>

Hi all,

OK, I'm a Perl virgin, so take it easy with me.  I have spent some time
checking deja and the FFAQs, but haven't been able to come up with an
answer...

I'm in the process of trying to persuade the powers that be here to take
up Perl as a standard for our build scripts, so I'm rewriting the build
script for one of our sites' products in Perl - this is on WinNT using
the ActivePerl distribution.

I need to process command line parameters to determine various aspects
of the build, but I've come across a quirk (at least, I think it's a
quirk).  If I call the script using:
perl script.pl param1 param2
then @ARGV contains param1 and param2 and is of length 2, whereas if I
omit the  leading 'perl', ie:
script.pl param1 param2
then @ARGV is of length -1 and contains nothing.

Is this to be expected?  Whilst I realise that this probably has more to
do with Wind'ohs than Perl, can I rectify it (other than by preceding
with 'perl')?

Cheers - Adam...

<pulls on asbestos undies>

--
Due to a series of random failures and an inability to concentrate on
more than one task at a time, I have been forced to concede that my
brain must be running Micro$oft products.


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


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

Date: Thu, 19 Oct 2000 13:25:47 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Newbie Question: command line parameters - WIN32
Message-Id: <JTAH5.6701$Uy5.223143@news000.worldonline.dk>

Adam wrote:

> Hi all,
> 
> OK, I'm a Perl virgin, so take it easy with me.  I have spent some time
> checking deja and the FFAQs, but haven't been able to come up with an
> answer...
> 
> I'm in the process of trying to persuade the powers that be here to take
> up Perl as a standard for our build scripts, so I'm rewriting the build
> script for one of our sites' products in Perl - this is on WinNT using
> the ActivePerl distribution.
> 
> I need to process command line parameters to determine various aspects
> of the build, but I've come across a quirk (at least, I think it's a
> quirk).  If I call the script using:
> perl script.pl param1 param2
> then @ARGV contains param1 and param2 and is of length 2, whereas if I
> omit the  leading 'perl', ie:
> script.pl param1 param2
> then @ARGV is of length -1 and contains nothing.
> 
> Is this to be expected?  Whilst I realise that this probably has more to
> do with Wind'ohs than Perl, can I rectify it (other than by preceding
> with 'perl')?
> 

read some documentation:

>perldoc perlrun
>perldoc Getopt::Long

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Thu, 19 Oct 2000 23:15:21 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Newbie Question: command line parameters - WIN32
Message-Id: <slrn8utpep.fji.mgjv@martien.heliotrope.home>

On Thu, 19 Oct 2000 11:11:24 GMT,
	Adam <acheney@my-deja.com> wrote:

> then @ARGV contains param1 and param2 and is of length 2, whereas if I
> omit the  leading 'perl', ie:
> script.pl param1 param2
> then @ARGV is of length -1 and contains nothing.
> 
> Is this to be expected?  Whilst I realise that this probably has more to
> do with Wind'ohs than Perl, can I rectify it (other than by preceding
> with 'perl')?

I believe it does have to do with windows, and I also seem to recall
that there was a question like this not too long ago on this group. It
has something to do with the way that windows ties extensions to
executables (or associates with, I forget the windows parlance). You
have to make sure that that tie includes command line flags. How to do
that I don't know. 

One of the threads on this group talking about this problem starts with
the message with ID <8s526g$1cjv$1@slrn.eurobell.net> and subject
'Perl/Windows problem'. The thread has G*d***** in it, so I didn't see
much of it when it was current. I just use deja to find it :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.   | make up 3/4 of the population.
NSW, Australia                  | 


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

Date: Thu, 19 Oct 2000 13:19:31 GMT
From: Giuseppe Monteleone <monte@sorint.it>
Subject: Problem with array
Message-Id: <39EEF502.86326711@sorint.it>

I write this code,
I write a script that convert a decimal number in binary, and put it in
a array, and a must do this for a sequence of number (e.g. from 1 to
50), my problem is that perl insert the successive binary number at the
begin of the script, and creat an array very long, while I need an array
for every conversion, this are my code, (I not found how to convert a
number from decima to binary with scalar variable)
for ($I = 1; $I > $a; $I ++)
@q = bnr ($I);  the call




****** custom function ******
sub bnr
my ($cifra) = ($_[0]);
while ($cifra !=0)
    $a = $cifra % 2;
    push (@binario,$a);
    $cifra = int $cifra / 2;

@binariok = reverse (@binario);
return @binariok;

thanks for your attention,
bye




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

Date: Thu, 19 Oct 2000 15:42:00 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Problem with array
Message-Id: <qTCH5.6731$Uy5.225029@news000.worldonline.dk>

Giuseppe Monteleone wrote:

> I write this code,
> I write a script that convert a decimal number in binary, and put it in
> a array, and a must do this for a sequence of number (e.g. from 1 to
> 50), my problem is that perl insert the successive binary number at the
> begin of the script, and creat an array very long, while I need an array
> for every conversion, this are my code, (I not found how to convert a
> number from decima to binary with scalar variable)
> for ($I = 1; $I > $a; $I ++)
> @q = bnr ($I);  the call
> 
> 
> 
> 
> ****** custom function ******
> sub bnr
> my ($cifra) = ($_[0]);
> while ($cifra !=0)
>     $a = $cifra % 2;
>     push (@binario,$a);
>     $cifra = int $cifra / 2;
> 
> @binariok = reverse (@binario);
> return @binariok;
> 
> thanks for your attention,
> bye
> 
> 

First, you may wish to take a look at pack(),
$perldoc -f pack

Second, in your sub you use global variables:

$a, @binario, @binaryok

You should use strict, and use warnings (or the -w switch

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Thu, 19 Oct 2000 12:13:41 +0100
From: "Andy McMullin" <andy@NOSPAM.rickham.net>
Subject: Re: Regex for matching e-mail addresses
Message-Id: <39eed686$1@news.jakinternet.co.uk>


"James Taylor" <james@NOSPAM.demon.co.uk> wrote in message
news:ant15165406cfNdQ@oakseed.demon.co.uk...

> There are probably lurkers reading this that know the format of Notes,
> cc:Mail, X.400, or MEMO format addresses, but who haven't bothered to
> post examples for me because they do not know of anywhere these are
> actually used in the wider context of the Net.

Having lurked into this one, some examples of my own (valid) addresses:

Notes:  Andy McMullin/Plymouth Business School/GB
X400: g=Andy;s=McMullin;ou=Business-School,o=Plymouth,p=uk.ac;a= ;c=gb

They both work fineon and across the net; however, if your system (on the
net) doesn't support the format you'll have to pass the mail through a
gateway.

Hope this helps.




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

Date: Thu, 19 Oct 2000 12:18:13 +0100
From: Kris Barker <mac-dev@demon.net>
Subject: Resource Fork Integrity Checks
Message-Id: <B6149705.10E0%mac-dev@demon.net>

This is using the Mac Perl port:

Does anyone know how to read the entire resource fork into memory whilst
giving it a filehandle?  Even individual resources would be a good start.
I've been looking at the resource manager perl implementation, but it
doesn't seem to offer that sort functionality.

Essentially, I want to read an entire resource fork into memory so that I
can then MD5 it.  MD5 requires a filehandle, while the resource manager only
provides a scalar handle.

Thanks



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

Date: Thu, 19 Oct 2000 10:52:54 -0400
From: SM <n0spam@mail.com>
Subject: Re: Search, pad, replace
Message-Id: <39EF0AC6.101E3F3D@mail.com>

DesQuite wrote:
> 
> This is a solution that will help us and needs to be done soon.
> This program is also the only program we have that uses Perl.
> We don't need extra help and we're not willing to pay someone else.
> 
> Thanks.  You're an asshole.

You don't know how to finish a job on your own (that you are presumably
getting paid for) but you refuse to pay for someone else to work on it
and then get mad when someone else calls you on that?  Have you ever
read Atlas Shrugged?

SM


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

Date: Thu, 19 Oct 2000 16:21:58 +0200
From: "Konstantin Schauwecker" <hi@konstantin-schauwecker.de>
Subject: using alerts
Message-Id: <8sn02a$ggo$1@news.online.de>

Hi everybody
I need some informations about using alerts. I tried
perldoc -f alert
but I got a "no documentation found".
Could anybody send me a link or a small listing?

Thanks, Konstantin




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

Date: Thu, 19 Oct 2000 16:32:55 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: using alerts
Message-Id: <aDDH5.7601$Tq1.262017@news010.worldonline.dk>

Konstantin Schauwecker wrote:

> Hi everybody
> I need some informations about using alerts. I tried
> perldoc -f alert
> but I got a "no documentation found".
> Could anybody send me a link or a small listing?
> 
> Thanks, Konstantin
> 
> 

http://www.webreference.com/js (doc javascript)

Btw, this is  *comp.lang.perl.misc*

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Thu, 19 Oct 2000 10:05:19 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: value exchange of two vars
Message-Id: <Pine.GSO.4.21.0010190959590.25707-100000@crusoe.crusoe.net>

[posted & mailed]

On Oct 19, Bart Lateur said:

>	$a = 10;
>	($x, $y) = ($a, $a++);
>	print "\$a is $x, \$a postincremented is $y\n";
>-->
>	$a is 11, $a postincremented is 10

I think this result comes about because the values in a list must first be
expanded.  If there's any expansion to be done, it occurs:

  print $a, ",", $a++;  # prints 1,0
  print "$a,", $a++;    # prints ,0

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

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


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