[18860] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1028 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 31 14:06:52 2001

Date: Thu, 31 May 2001 11:05:16 -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: <991332315-v10-i1028@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 31 May 2001     Volume: 10 Number: 1028

Today's topics:
    Re: Built in functions to format ISO Date YYYYMMDD. (Abigail)
    Re: Complicated...heh (Tad McClellan)
    Re: Complicated...heh <bart.lateur@skynet.be>
    Re: Controlling downloads using CGI and Apache nobull@mail.com
    Re: datacalc.pm (Helgi Briem)
    Re: datacalc.pm <mjcarman@home.com>
    Re: datacalc.pm <sb@engelschall.com>
        FLOCK numericals? <davsoming@lineone.net>
    Re: FLOCK numericals? (Michel Dalle)
    Re: frustration with cgi.pm and setting cookies. <andras@mortgagestats.com>
    Re: frustration with cgi.pm and setting cookies. <flavell@mail.cern.ch>
    Re: frustration with cgi.pm and setting cookies. <lmoran@wtsg.com>
    Re: Getting Users' IP <comdog@panix.com>
    Re: Getting Users' IP <comdog@panix.com>
    Re: Getting Users' IP <bart.lateur@skynet.be>
    Re: HELP with IPC <dennis.kowalsk@daytonoh.ncr.com>
    Re: HELP with IPC (Anno Siegel)
        Need help with Regex <chquek@yahoo.com>
    Re: Need help with Regex <rsherman@ce.gatech.edu>
    Re: Need help with Regex (Anno Siegel)
    Re: Opinion on undef lvalue nobull@mail.com
        passing arguments to my script from a web browser <m.h.a.reuvekamp@student.utwente.nl>
    Re: passing arguments to my script from a web browser <peb@bms.umist.ac.uk>
    Re: passing arguments to my script from a web browser <m.h.a.reuvekamp@student.utwente.nl>
    Re: passing arguments to my script from a web browser <godzilla@stomp.stomp.tokyo>
    Re: passing arguments to my script from a web browser (John Joseph Trammell)
    Re: passing arguments to my script from a web browser nobull@mail.com
    Re: passing arguments to my script from a web browser <godzilla@stomp.stomp.tokyo>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 31 May 2001 15:49:33 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Built in functions to format ISO Date YYYYMMDD.
Message-Id: <slrn9hcq0d.36u.abigail@tsathoggua.rlyeh.net>

James (visionary@yahoo.com) wrote on MMDCCCXXIX September MCMXCIII in
<URL:news:21f63013.0105301528.52dbaf31@posting.google.com>:
??  All,
??  
??  
??     I am getting a date in the YYYYMMDD format and I need to format in
??  in to MM/DD/YYYY and Month DD, YYYY for presentation. Is there any
??  functions built in to perl that can do this?


s///


Abigail
-- 
@;=split//=>"Joel, Preach sartre knuth\n";$;=chr 65;%;=map{$;++=>$_}
0,22,13,16,5,14,21,1,23,11,2,7,12,6,8,15,3,19,24,14,10,20,18,17,4,25
;print@;[@;{A..Z}];


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

Date: Thu, 31 May 2001 07:29:08 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Complicated...heh
Message-Id: <slrn9hcao3.4ra.tadmc@tadmc26.august.net>

Steven Michaels <smichae@ilstu.edu> wrote:

>What I think the problem is, is that $buf is read once, as a huge
>source, without splitting the lines.


Then don't read it at once. Read in line-by-line and join up
lines that end in a hyphen.

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

while (<DATA>) {
   $_ .= <DATA> if s/-\n//;
   print;
}

__DATA__
MOC007-015-019-027-029-051-053-085-089-125-131-135-141-151-159-169-
195-310300-
----------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 31 May 2001 17:02:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Complicated...heh
Message-Id: <v8ucht4c2eqlac6m9nvoqohv4ci5usr2mf@4ax.com>

Tad McClellan wrote:

>Steven Michaels <smichae@ilstu.edu> wrote:
>
>>What I think the problem is, is that $buf is read once, as a huge
>>source, without splitting the lines.
>
>Then don't read it at once. Read in line-by-line and join up
>lines that end in a hyphen.

That's too hard work.

Just drop the newline if the line ends with a hyphen.

	while(<>) {
	     s/-\n/-/;
	     print;
	}

or, just the s/-\n/-/ with the -p option.

-- 
	Bart.


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

Date: 31 May 2001 17:53:25 +0100
From: nobull@mail.com
Subject: Re: Controlling downloads using CGI and Apache
Message-Id: <u9g0dla29m.fsf@wcl-l.bham.ac.uk>

david.obrien@ssmb.com.au (Dave) writes but does not attibute to me: 

> >That is a totally unnecessary (and hence anti-social) disruption of
> >the HTTP caching mechanism.
> 
> Maybe so, but how do I prevent direct URL access?

Do not let people know the direct URL.

Dave snipped the bit where I <nobull@mail.com> wrote:

> rgarciasuarez@free.fr (Rafael Garcia-Suarez) writes:
>
> > Note that this can be implemented in many other langages; your question
> > is not Perl-specific, so I suggest to ask for further info in a more
> > appropriate newsgroup, such as comp.infosystems.www.authoring.cgi.
> 
> Please see previous answers by me (and others) to similar questions in
> that newsgroup.

I still advise that.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 31 May 2001 14:18:07 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: datacalc.pm
Message-Id: <3b165177.106301563@news.isholf.is>

On 30 May 2001 23:22:48 -0700, dirk.lorenz@de.ac-service.com
(Dirk Lorenz) wrote:

>Hellp NG,
>
>where can i get a compiled Version of the module datcalc.pm for Active
>Perl bcause i have no C Compiler.
>

There does not appear to be a datcalc.pm nor a
datacalc.pm module on CPAN, so you are out of
luck.

If you are talking about Date::Calc, you should
use the Perl Package Manager ppm.pl that comes
bundled with your Activestate distribution to
install it although I think it comes preinstalled.
No need for a C compiler.

Regards,
Helgi Briem


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

Date: Thu, 31 May 2001 08:39:19 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: datacalc.pm
Message-Id: <3B164987.47E0D485@home.com>

Dirk Lorenz wrote:
> 
> where can i get a compiled Version of the module datcalc.pm for Active
> Perl bcause i have no C Compiler.

Your subject line has "datacalc," your message has "datcalc," and I
can't find either. I *can* find "Date-Calc" though. I'm guessing that's
the one you're after.

Short answer:
Go to a DOS prompt and type "ppm install date-calc" (w/o the quotes)

Long answer:
ActivePerl comes with a utiltity called PPM (Perl Package Manager) which
allows you to easily download and install many (but not all) of the Perl
modules available. While this isn't really necessary for modules which
are pure Perl, it is convenient; and it's a blessing for modules with
compiled components (like the ones that use XS). Instructions on how to
use PPM come with the documentation that installs with ActivePerl.

-mjc


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

Date: Thu, 31 May 2001 16:18:15 +0200
From: Steffen Beyer <sb@engelschall.com>
Subject: Re: datacalc.pm
Message-Id: <7rj5f9.rtk.ln@imperia.net>

Dirk Lorenz <dirk.lorenz@de.ac-service.com> wrote:

> Hellp NG,
> 
> where can i get a compiled Version of the module datcalc.pm for Active
> Perl bcause i have no C Compiler.
> 
> Thanks for your help.
> 
> Dirk Lorenz

From Date::Calc's README file (since that's what you want,
I suppose):

If you compile under Windows, note that you will need
exactly the same compiler your Perl itself was compiled
with! (This is also true for Unix, but rarely a problem.)

Moreover, you usually cannot build any modules under
Windows 95/98, the Win 95/98 command shell is too dumb.
You will need the Windows NT command shell ("cmd.exe")
or the "4DOS" shell.

Note that ActiveState provides precompiled binaries
of the module Date::Calc for their Win32 port of Perl
("ActivePerl") on their web site, which you should be
able to install simply by typing "ppm install Date-Calc"
in your MS-DOS command shell (but note the "-" instead
of the "::"!). This also works under Windows 95/98.

If your firewall prevents "ppm" from downloading these
packages, you can also download them manually from
http://www.activestate.com/ppmpackages/5.005/zips/ or
http://www.activestate.com/ppmpackages/5.6/zips/.
Follow the installation instructions included in
the "zip" archives.

Note also that a "plain Perl" version of "Date::Calc" called
"Date::Pcalc" exists (written by J. David Eisenberg); you
should be able to download it from the same place where
you found this package, or from David's web site at
http://catcode.com/date/pcalc.html.

Hope this helps.
-- 
    Steffen Beyer <sb@engelschall.com>
    (This message may not be replyable. Use address on line above instead!)
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: Thu, 31 May 2001 06:51:54 +0100
From: "David Soming" <davsoming@lineone.net>
Subject: FLOCK numericals?
Message-Id: <thcvg02sgude65@corp.supernews.co.uk>

Hi,
If I were to write for example...
open (EMAILS, ">>address.txt");
flock(EMAILS, 2);
print EMAILS "$email\n";
flock(EMAILS, 8);
close (EMAILS);

Does '2' read the file and '8' append it?
If so, what's the significance of 2 & 8? can you use any additional numbers
to do other things?

Thanks
DAVID






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

Date: Thu, 31 May 2001 17:44:26 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: FLOCK numericals?
Message-Id: <9f606c$3po$1@dackel.pdb.sbs.de>

In article <thcvg02sgude65@corp.supernews.co.uk>, "David Soming" <davsoming@lineone.net> wrote:
>Hi,
>If I were to write for example...
>open (EMAILS, ">>address.txt");
>flock(EMAILS, 2);
>print EMAILS "$email\n";
>flock(EMAILS, 8);
>close (EMAILS);
>
>Does '2' read the file and '8' append it?
>
>If so, what's the significance of 2 & 8? can you use any additional numbers
>to do other things?

No, open(...,">>...") opens the file for append, and
flock(...,...) takes care of file locking.

These and other issues are described in more detail in
perlopentut.
You can find it in your Online Documentation, or by typing
"perldoc perlopentut" in a DOS box or shell.

As for the meaning of 2 and 8, you'll find them in the description
of flock in perlfunc (type "perldoc -f flock" or read perlfunc for
more details) :

=====================
OPERATION is one of LOCK_SH, LOCK_EX, or LOCK_UN, possibly
combined with LOCK_NB. These constants are traditionally valued
1, 2, 8 and 4, but you can use the symbolic names if you import them
from the Fcntl module, either individually, or as a group using the ':flock' 
tag. LOCK_SH requests a shared lock, LOCK_EX requests an exclusive
lock, and LOCK_UN releases a previously requested lock. If LOCK_NB is
bitwise-or'ed with LOCK_SH or LOCK_EX then flock will return immediately 
rather than blocking waiting for the lock (check the return status to see if
you got it).
=====================

Michel.


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

Date: Thu, 31 May 2001 09:47:19 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: frustration with cgi.pm and setting cookies.
Message-Id: <3B164B67.D178CBA4@mortgagestats.com>



Kenneth Johansen wrote:

> Andras Malatinszky wrote:
>
> > kenneth johansen wrote:
> >
> > > Im sorry if this has been beaten to deah in another thread.
> > > im also sorry if this is the wrong group, but im not sure where else to
> > > try.
> > >
> > > anyways. for the last couple of weeks i have been working on a project
> > > that requires me to set a cookie. For my project i have chosen to use
> > > cgi.pm
> > >
> > > so heres the deal, i set the cookie, i check it (look fine), then do a
> > > redirect to a "cookie_test.cgi" file
> > > that checks the cookie.. the problem is that "cookie_test.cgi" doesnt
> > > find any cookie.
> > > Afew lines of code:
> > >
> > > i set the cookie and redirect with:
> > > -------------------------------
> > > my $cookie = $q->cookie( -name => "somehing",
> > >                            -path => "/somewhere",
> > >                            -value => "something",
> > >                            -expires=> "somedate");
> > > print $q->redirect (-url =>"http://somewhere/path/to/cookie_test.cgi",
> > > -cookie => $cookie);
> > > ------------------------------------
> > >
> > > in cookie_test.cgi i read the cookie with:
> > > --------------------------------------------
> > > my $cookie = $q->cookie( -name => "something" );
> > > ---------------------------------------------
> > > and this doesnt return anything
> > >
> > > in both programs im using:
> > >
> > > #!/usr/bin/perl -wT
> > > use strict;
> > > use CGI;
> > > my $q = new CGI;
> >
> > You are setting a cookie called "somehing" and you are trying to read one
> > called "something". You can't blame the poor machine for not finding it.
>
> rest assured, "somehing" was a typo on my part in this post, the actuall
> words
> used are the same.
>

Well, if you want advice on the actual code you are trying to get to work, you
should post the actual code you are trying to get to work. I mean, there are a
zillion things that can cause your problem: a mismatch in domain or path,
another typo -- how could we possibly try to fix your program without seeing
it?



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

Date: Thu, 31 May 2001 15:56:31 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: frustration with cgi.pm and setting cookies.
Message-Id: <Pine.LNX.4.30.0105311552380.22163-100000@lxplus003.cern.ch>

On Thu, 31 May 2001, Kenneth Johansen wrote:

[excessive quotage now snipped]

> rest assured, "somehing" was a typo on my part in this post, the actuall
> words
> used are the same.

Rest assured, few people will bother reading your code now that they
know it can't be trusted to represent your actual problem.

You might want to check the cookie rules to see whether your cookie is
properly eligible to be sent to a foreign domain.  But that's
off-topic for this group - f'ups to a more relevant place have been
suggested.



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

Date: Thu, 31 May 2001 12:45:20 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: frustration with cgi.pm and setting cookies.
Message-Id: <5nrcht4tf9dhldo1pmh2mblrcishjfc7ar@4ax.com>

On Thu, 31 May 2001 13:12:53 +0200, kenneth johansen
<kennethj@student.uit.no> wrote wonderful things about sparkplugs:

SNIP
>
>in both programs im using:
>
>#!/usr/bin/perl -wT
>use strict;
>use CGI;
>my $q = new CGI;
>
>any reply appriciated as im all out of ideas.

use diagnostics ;

It will actually tell you that you have named one of your variables
wrong ($somehing, $something).  Until you can figure out what the -w
error messages mean use diagnostics ; is EXTREMELy useful.



>
>regards
>kenneth johansen
>kennethj@stud.cs.uit.no

--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com


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

Date: Thu, 31 May 2001 10:03:42 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Getting Users' IP
Message-Id: <comdog-E2A23D.10034231052001@news.panix.com>

In article <1103_991306344@peterrei>, Peter Reid 
<peter.reid2000@ntlworld.com> wrote:

> I had been using 

> my $userip=remote_host;

> to store the IP address of everyone submitting entries to my guestbook. When it came to making a complaint to an ISP, they said I was recording the IP of their proxy 
> server and not of the person who had abused my guestbook. They said I should use

> my $userip=HTTP_CLIENT_IP;

if this particular ISP is indeed putting the client IP number in that environment 
variable, you need to look in %ENV to get it.

    my $userip=$ENV{'HTTP_CLIENT_IP'};

-- 
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: Thu, 31 May 2001 10:08:51 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Getting Users' IP
Message-Id: <comdog-474ACB.10085131052001@news.panix.com>

In article <9f59t2$o3e$1@news.tudelft.nl>, "Maarten Veerman" 
<news@_NOSPAM_mtvwebdesign.hypermart.net> wrote:

[re-formatted.  please post the reply after the original text ]

> "Peter Reid" <peter.reid2000@ntlworld.com> wrote in message
> news:1103_991306344@peterrei...

> > my $userip=remote_host;

> > to store the IP address of everyone submitting entries to my guestbook.
> When it came to making a complaint to an ISP, they said I was recording the
> IP of their proxy
> > server and not of the person who had abused my guestbook. They said I
> should use
> >
> > my $userip=HTTP_CLIENT_IP;
> >
> > but Perl just says "Bareword 'HTTP_CLIENT_IP'  not allowed while strict
> subs in use" which to me means it doesn't understand the variable!!?? What
> is the correct
> > environment variable of the client IP -- the person accessing my
> script????


> Well, it seems that in the first line, you are calling a sub named
> remote_host or something, since there is no internal perl variable/function
> named remove_host.

remote_host() is from CGI.pm.

    http://www.perldoc.com/cpan/CGI.html

> About the HTTP_CLIENT_IP. I don't think that is a standard environment
> variable.
> You should try REMOTE_ADDR.

that's what remote_host() does, with a possible DNS lookup.  the
ISP has already said that they need a different address, which is
why the OP has a query.  see the original post.

 
> my $userip = $ENV{'REMOTE_ADDR'} || $ENV{'HTTP_CLIENT_IP'} ||
> $ENV{'REMOTE_HOST'};

> This code will set userip to remote-host if neither remote_addr nor
> http_client_ip didn't exist

if $ENV{'REMOTE_ADDR'} doesn't work, why do you think $ENV{'REMOTE_HOST'}
will?  they come from the same information.

-- 
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: Thu, 31 May 2001 17:58:15 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Getting Users' IP
Message-Id: <mb1dhtgp9goth1vt6f32skl1klinc6dhho@4ax.com>

brian d foy wrote:

>> my $userip=HTTP_CLIENT_IP;
>
>if this particular ISP is indeed putting the client IP number in that environment 
>variable, you need to look in %ENV to get it.
>
>    my $userip=$ENV{'HTTP_CLIENT_IP'};

The ISP? Isn't it the proxy that defines what header (-> environment
variable) that contains the address?

I have to use a proxy, and on the server side, I can see a user variable
HTTP_X_FORWARDED_FOR that contains the IP.

-- 
	Bart.


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

Date: Thu, 31 May 2001 11:25:09 -0400
From: "Dennis Kowalski" <dennis.kowalsk@daytonoh.ncr.com>
Subject: Re: HELP with IPC
Message-Id: <3b166253$1@rpc1284.daytonoh.ncr.com>


Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:9f2b0l$lh4$1@mamenchi.zrz.TU-Berlin.DE...
> According to Dennis Kowalski <dennis.kowalsk@daytonoh.ncr.com>:
>
> > Here is the code from script #1 which creates the IPC queue.
> >
> > eval 'sub IPC_CREAT {0001000}' unless defined &IPC_CREAT;
> > eval 'sub IPC_NOWAIT {0004000}' unless defined &IPC_NOWAIT;
>
> I'll assume you are doing this only during testing.  IPC::SysV
> defines these constants.
>
> [snip code that successfully creates a message queue]
>
> > dennis> ipcs -qa | grep dkow
>
> -a (all) overrides -q (queues) in ipcs.  you want "ipcs -q".
>
> > q   2004 0x000003e7 --rw-rw-rw- dkowalsk  sysarch dkowalsk  sysarch
0
> > 0
> >   65535     0     0 no-entry no-entry  8:39:51
> >
> >
> > Here is the code from script #2 which is trying to send a message to an
IPC
> > queue which has been created by  script  #1 which previously ran.
>
> [...]
>
> >       eval 'sub IPC_RMID {0}' unless defined &IPC_RMID;
> >       eval 'sub IPC_NOWAIT {0004000}' unless defined &IPC_NOWAIT;
> >
> >       $key = 999;
> >      $queue = msgget($key, 0);
> >
> > # this does return the proper id of the ipc queue
> > # $queue contains the id of 2004
> >
> >      $message = pack("La*", 0, "XXXXXX");
>                               ^
> This is your error.  That "0" specifies the message type which
> must be > 0.
>
> [snip rest]
>
> Let me add that the only way to find that error is to carefully
> look at the pertinent man pages.  I did that.  Why didn't you?
>
> Anno

#1
 Thanks for responding. You are correct, the type must be > 0.

#2
I think you are wrong on the ipcs -qa

ipcs -q gives brief info on the queues

ipcs -qa gives all the information on the queues

ipcs -a gives all the information on ALL the IPC resources.
That is queues, semaphores and shared memory segments.

#3
I guess I was just in a little bit rushed in trying to find a solution.
I missed the type > 0 in the man pages but I guess if everyone read the man
pages in minute detail, we would have no need for this group.







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

Date: 31 May 2001 16:53:49 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: HELP with IPC
Message-Id: <9f5sut$p09$1@mamenchi.zrz.TU-Berlin.DE>

According to Dennis Kowalski <dennis.kowalsk@daytonoh.ncr.com>:
> 
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote in message
> news:9f2b0l$lh4$1@mamenchi.zrz.TU-Berlin.DE...
> > According to Dennis Kowalski <dennis.kowalsk@daytonoh.ncr.com>:

[...]

> > >      $message = pack("La*", 0, "XXXXXX");
> >                               ^
> > This is your error.  That "0" specifies the message type which
> > must be > 0.
> >
> > [snip rest]
> >
> > Let me add that the only way to find that error is to carefully
> > look at the pertinent man pages.  I did that.  Why didn't you?
> >
> > Anno
> 
> #1
>  Thanks for responding. You are correct, the type must be > 0.
> 
> #2
> I think you are wrong on the ipcs -qa
> 
> ipcs -q gives brief info on the queues
> 
> ipcs -qa gives all the information on the queues
> 
> ipcs -a gives all the information on ALL the IPC resources.
> That is queues, semaphores and shared memory segments.

Then your implementation differs from mine.

> #3
> I guess I was just in a little bit rushed in trying to find a solution.
> I missed the type > 0 in the man pages but I guess if everyone read the man
> pages in minute detail, we would have no need for this group.

Not at all.  The group's purpose is the discussion of the Perl
language.  If, by some miracle, all questions ceased there would
still be lots of material for discussion.

That most of the traffic is generated by questions (and roughly half
of them not about Perl) is a fact of life, but doesn't define the
purpose of the newsgroup.

As for your specific question, it was posed better than many, and
marginally on topic, so I gave it a try.  It soon turned out, that
simply looking up the error message (Invalid argument) in the msgsnd
man page gives you three possible reasons for this error, one of them
"nonpositive mtype value".  That made me feel I did your homework
for you and made me grumpy.

Anno

man page any more than 


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

Date: Thu, 31 May 2001 23:06:01 +0800
From: chquek <chquek@yahoo.com>
Subject: Need help with Regex
Message-Id: <3B165DD9.EDAAEAC0@yahoo.com>

Hi :

I have a string of the following format :

    A,"123,456,789.00","345,234,456.11",D,E

what i want is :

    A,123456789.00,345234456.11,D,E

I know how to extract and remove the double quotes "  with

  s/"(.+?)"/$1/g

but how do I remove the commas in $1   ???

TIA





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

Date: Thu, 31 May 2001 22:17:28 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: Need help with Regex
Message-Id: <3B167CA8.5D124D12@ce.gatech.edu>

something like

$1 =~ s/,//g;

should work....


chquek wrote:

> Hi :
>
> I have a string of the following format :
>
>     A,"123,456,789.00","345,234,456.11",D,E
>
> what i want is :
>
>     A,123456789.00,345234456.11,D,E
>
> I know how to extract and remove the double quotes "  with
>
>   s/"(.+?)"/$1/g
>
> but how do I remove the commas in $1   ???
>
> TIA



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

Date: 31 May 2001 17:49:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need help with Regex
Message-Id: <9f607m$q2f$2@mamenchi.zrz.TU-Berlin.DE>

According to Robert Sherman  <rsherman@ce.gatech.edu>:
> chquek wrote:
 
[reformatted]  Please place your reply *after* the quoted text.

> > Hi :
> >
> > I have a string of the following format :
> >
> >     A,"123,456,789.00","345,234,456.11",D,E
> >
> > what i want is :
> >
> >     A,123456789.00,345234456.11,D,E
> >
> > I know how to extract and remove the double quotes "  with
> >
> >   s/"(.+?)"/$1/g
> >
> > but how do I remove the commas in $1   ???
> >
> > TIA

> something like
> 
> $1 =~ s/,//g;
> 
> should work....

You didn't test that.  Please don't post untested code.

To the OP:  There are modules on CPAN that deal with data of this
type.  You're looking for the keyword CSV for comma-separated values.

Anno


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

Date: 31 May 2001 17:59:34 +0100
From: nobull@mail.com
Subject: Re: Opinion on undef lvalue
Message-Id: <u9ae3ta1zd.fsf@wcl-l.bham.ac.uk>

"John Lin" <johnlin@chttl.com.tw> writes:

> sub foo :lvalue { undef }
> foo = 'better';
> 
> died: Can't return a readonly value from lvalue subroutine at line 2.
> IMHO, it is inconsistent with existing usage of undef lvalue.

> I suggest new version of Perl would follow the same logic to treat
> "assignment to undef lvalue" as just an NOP.  What do you think about it?

I agree, unless it turns out to be hard to do.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 31 May 2001 16:50:25 +0200
From: "Marcel Reuvekamp" <m.h.a.reuvekamp@student.utwente.nl>
Subject: passing arguments to my script from a web browser
Message-Id: <9f5lhl$ac2$1@dinkel.civ.utwente.nl>

Hi all,

I've made myself a script which gets some arguments. It works just fine if I
give them from the commanline, but then there's the problem. I want to use
it in my browser. So there's my question, does anyone know how I can pass
some arguments from my browser to my script?

thanks,
Marcel




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

Date: Thu, 31 May 2001 16:10:07 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: passing arguments to my script from a web browser
Message-Id: <3B165ECF.4E82F3B9@bms.umist.ac.uk>

Marcel Reuvekamp wrote:
> 
> Hi all,
> 
> I've made myself a script which gets some arguments. It works just fine if I
> give them from the commanline, but then there's the problem. I want to use
> it in my browser. So there's my question, does anyone know how I can pass
> some arguments from my browser to my script?
> 

CGI ?


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

Date: Thu, 31 May 2001 17:20:40 +0200
From: "Marcel Reuvekamp" <m.h.a.reuvekamp@student.utwente.nl>
Subject: Re: passing arguments to my script from a web browser
Message-Id: <9f5nac$bea$1@dinkel.civ.utwente.nl>

Why else would I post here?

"Paul Boardman" <peb@bms.umist.ac.uk> wrote in message
news:3B165ECF.4E82F3B9@bms.umist.ac.uk...
> Marcel Reuvekamp wrote:
> >
> > Hi all,
> >
> > I've made myself a script which gets some arguments. It works just fine
if I
> > give them from the commanline, but then there's the problem. I want to
use
> > it in my browser. So there's my question, does anyone know how I can
pass
> > some arguments from my browser to my script?
> >
>
> CGI ?




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

Date: Thu, 31 May 2001 08:30:05 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: passing arguments to my script from a web browser
Message-Id: <3B16637D.A7C0057D@stomp.stomp.tokyo>

Marcel Reuvekamp wrote:

> I've made myself a script which gets some arguments. It works just fine if I
> give them from the commanline, but then there's the problem. I want to use
> it in my browser. So there's my question, does anyone know how I can pass
> some arguments from my browser to my script?

You may use a query string appended to an URL pointing
to your script or, you may use an html form action which
points to your script and has text fields for entry of
your arguments.

A read and parse routine will need to be added to your script.

Godzilla!


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

Date: Thu, 31 May 2001 15:58:08 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: passing arguments to my script from a web browser
Message-Id: <slrn9hco0u.j20.trammell@bayazid.hypersloth.net>

[top-posting fixed]
On Thu, 31 May 2001 17:20:40 +0200, Marcel Reuvekamp wrote:
>"Paul Boardman" <peb@bms.umist.ac.uk> wrote in message
>news:3B165ECF.4E82F3B9@bms.umist.ac.uk...
>>Marcel Reuvekamp wrote:
>>>
>>> I've made myself a script which gets some arguments. It works just
>>> fine if I give them from the commanline, but then there's the
>>> problem. I want to use it in my browser. So there's my question,
>>> does anyone know how I can pass some arguments from my browser
>>> to my script?
>>
>> CGI ?
> 
> Why else would I post here?

If your question is "How do I do CGI in Perl?", there's a delightful
CGI perl module available, called "CGI.pm"; documentation for it is
very likely available as part of your Perl installation.

If your question is anything else, please clarify.

-- 
Just Another Perl Hacker.


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

Date: 31 May 2001 18:08:34 +0100
From: nobull@mail.com
Subject: Re: passing arguments to my script from a web browser
Message-Id: <u97kyxa1kd.fsf@wcl-l.bham.ac.uk>

"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:

> Marcel Reuvekamp wrote:
> 
> > I've made myself a script which gets some arguments. It works just fine if I
> > give them from the commanline, but then there's the problem. I want to use
> > it in my browser. So there's my question, does anyone know how I can pass
> > some arguments from my browser to my script?

I missed the beginning of this thread but it sounds like you need to
install web server software that implements CGI - most do.
 
> You may use a query string appended to an URL pointing
> to your script or, you may use an html form action which
> points to your script and has text fields for entry of
> your arguments.
> 
> A read and parse routine will need to be added to your script.

s/added to/used by/

Actually there is a way of encoding parameters into a URL in such a
way that CGI will pass them directly as command line arguments to the
script.  It's not widely used these days but it is still part of CGI.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 31 May 2001 10:44:42 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: passing arguments to my script from a web browser
Message-Id: <3B16830A.113F9E1E@stomp.stomp.tokyo>

nobull@mail.com wrote:
 
> Godzilla! wrote:
> > Marcel Reuvekamp wrote:

I remind you of this again. You should direct your
comments to the originating author, not to me.
Please work on this bad habit of yours of responding
to me instead of the originating author.

Godzilla!


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1028
***************************************


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