[13199] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 609 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 21 11:07:17 1999

Date: Sat, 21 Aug 1999 08:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 21 Aug 1999     Volume: 9 Number: 609

Today's topics:
    Re: $$var[xxx] vs ${var}[xxx] (Irwin Feuerstein)
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
    Re: Attn: CRAP (was Re: voting system pealse advise) (Kevin Reid)
    Re: determining a leap year <owensk@cadvision.com>
    Re: How to distinguish strings 'A|\\|B|'  from 'A|\B|'  (Larry Rosler)
    Re: How to distinguish strings 'A|\\|B|'  from 'A|\|B|' holmberg@NoSpam.net
        How to print a date in ISO week # format <jriera@retemail.es>
        killing my child (Bill Moseley)
    Re: Message-ID vs. Reference Header <bill@fccj.org>
        Running and executable file from Perl <whassan@cs.concordia.ca>
    Re: Running and executable file from Perl <whassan@cs.concordia.ca>
        Running CGI scripts on my PC <hult.holmstrom@swipnet.se>
    Re: Running CGI scripts on my PC <Webdesigner@NewWebSite.com>
    Re: Time as per IST?? (Bill Moseley)
    Re: Time as per IST?? <flavell@mail.cern.ch>
        vacation doesn't work with domain name. Alternative in  <neil@pacifier.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sat, 21 Aug 1999 14:53:09 GMT
From: websites@erols.com (Irwin Feuerstein)
Subject: Re: $$var[xxx] vs ${var}[xxx]
Message-Id: <37beb864.49816380@news.erols.com>

These curly braces are confusing to me. Let's go back to the
beginning.

First, is $var the same as ${var}? Is there a rationale for using one
over the other?

On page 41 of Programming Perl, there is "how ${verb}able". Why is it
coded like that? Is "{$verb}able" the same as "${verb}able"? There
must be a difference, no?

Irwin



On 18 Aug 1999 09:33:45 -0700, merlyn@stonehenge.com (Randal L.
Schwartz) wrote:

>>>>>> "Jon" == Jon Peterson <jpeterson@office.colt.net> writes:
>
>>> $$var[xxx]
>
>Jon> The thingy that $var[xxx] is a reference to. @var is an array. $var[xxx] is a
>Jon> particular element of @var, which we assume here contains a reference.
>Jon> $$var[xxx] the thing (a scalar thing) that that reference refers to.
>
>No.  It's the same as the one below.  $$var[xxx] is the same as
>${$var}[xxx] and $var->[xxx].  You might be thinking of ${$var[xxx]}
>instead, which is a different construct and requires those braces.
>
>>> $${var}[xxx]
>
>Jon> Ouch :-). The brackets are redundant here, and rather confusing. This is the
>Jon> same as $$var[xxx].
>
>Correct, although you probably would have incorrectly parsed *that* as
>${$var[xxx]}. :)
>
>print [qw(Just another Perl hacker,)]->[$_]," " for 0..3
>
>-- 
>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
><merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
>Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
>See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

Date: Sat, 21 Aug 1999 10:24:02 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage935231041.22826@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 18 Aug 1999

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://www.cpan.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://www.cpan.org/
    http://www.perl.com/CPAN/
    http://www.cpan.org/doc/FAQs/FAQ/html/
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: Sat, 21 Aug 1999 07:14:52 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Attn: CRAP (was Re: voting system pealse advise)
Message-Id: <1dwtue3.1u0oufxqhj0yaN@imac.loc>

Larry Rosler <lr@hpl.hp.com> wrote:

> Actually, fewer characters like this (which scores an eagle):
> 
>   &{{
>       ...
>       ...
>   }->{$FORM{action}};
> 
> But the ->() form is more elegant, or at least more modern.

Personally, that's my favorite construct for switching based on a
variable. You might also want to avoid fatal errors:

   &{{
       ...
       ...
   }->{$FORM{action} || \&oops};

-- 
 Kevin Reid: |    Macintosh:      
  "I'm me."  | Think different.


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

Date: Sat, 21 Aug 1999 07:59:53 -0600
From: "K C Owens" <owensk@cadvision.com>
Subject: Re: determining a leap year
Message-Id: <37beb0db@news.cadvision.com>

A year divisible by 4 is a leap year unless it is divisible by 400.  2000 is
a leap year but 2100 is not.
Abigail wrote in message ...
>Linda Minnich (lin.minnich@usa.net) wrote on MMCLXXVI September MCMXCIII
>in <URL:news:37b80e37.3412597@nntp.lucent.com>:
>&& Does anyone know much about an algorithm to determine whether or not
>&& the current year is a leap year or not?  I'm trying find one!  I don't
>&& remember how many years are inbetween leap years, or even when the
>&& last or next one is!!! If you could just help me out with that tiny
>&& amt of info I would be greatful and I could write my own algorithm.
>
>
>So... what's your Perl question?
>
>
>
>Abigail
>--
>package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
>                                      print } sub __PACKAGE__ { &
>                                      print (     __PACKAGE__)} &
>                                                  __PACKAGE__
>                                            (                )
>
>
>  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
>------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers
==-----




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

Date: Sat, 21 Aug 1999 00:36:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to distinguish strings 'A|\\|B|'  from 'A|\B|' ?
Message-Id: <MPG.1227f6e86f5f803b989e8f@nntp.hpl.hp.com>

In article <37bdf7e8.31505799@news.tiac.net> on Sat, 21 Aug 1999 
01:13:00 GMT, holmberg@NoSpam.net <holmberg@NoSpam.net> says...
> Is it even possible to distinguish these two strings as read from a file?

Yes, because they are different when read from a file.

> Problem is, I have database dumps with fields distinguished by '|', but the '|'
> is also present as a literal as '\|' and so should not be treated as a field
> separator, and worse, escaped backslashes are present
> (there are even cases where 'A|\\|B' is present, which is a fragment with
> a field contains only a '\' in escaped form;  and this is distinguished from 
>  'A|\|B'  which is one field ending with 'A', and the next starting with
> '\|B'  (that is, the '\' is in escaped form).  A variety of techniques would
> work if it were possible to treat the characters in these input strings
> as straight characters (no interpolation at all), but that doesn't seem
> possible.

A split on /\|/ would result in A \\ B in the first case (two characters 
in the second field) and A \ B in the second case (one character in the 
second field).

> To illustrate the problem, the strings below are not distinguished, and
> I haven't been able to find a way to distinguish them because interpolation
> of '\\' hits before I can do anything.  Is there any way to turn off
> interpolation in a local context?

No, but there is no interpolation here.  You mean 'escape processing'.

> # Sample showing failure to distinguish strings - these produce
> # the same results:
> printf "length %d %s %s\n",length('A|\|C|'),'A|\|C|',quotemeta('A|\|C|');
> printf "length %d %s %s\n",length('A|\\|C|'),'A|\|C|',quotemeta('A|\\|C|');

They produce the same results because they are the same strings.  Really 
the same.  In single-quoted context, either \ (not followed by a single-
quote) or \\ produce a single backslash.

To get two backslashes into a string (either single- or double-quoted), 
you must use four (\\\\).

> What is desirable is when splitting (these are being read from a file) is to get
> the following splits:
> 'A|\|C|'  splits into ('A','\|C')          (2 components)
> 'A|\\|C|'  splits into ('A','\\','C')     (3 components)
> 
> Now how can that be done within Perl given that these two strings
> appear so fundamentally  indistinguishable?

I couldn't do it with split(), but here's a regex solution:


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

print join('+' =>

  /(           # start capture
    (?:        #   a sequence of either
      \\[\\|]  #     an escaped backslash or vertical bar
    |          #   or
      [^|]     #     any character except vertical bar
    )+         #   don't allow fields to be empty
   )           # end capture
  /gx), "\n"

for qw( A|\|C A|\\\\|C );

__END__

Output:

A+\|C
A+\\+C

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 21 Aug 1999 13:21:02 GMT
From: holmberg@NoSpam.net
Subject: Re: How to distinguish strings 'A|\\|B|'  from 'A|\|B|' ?
Message-Id: <37be9473.1608259@news.tiac.net>

On Sat, 21 Aug 1999 00:36:45 -0700, lr@hpl.hp.com (Larry Rosler) wrote:

Thanks for your reply.

From your response I take it that Perl cannot solve this simple parsing problem.


You indicated the fragments 'A|B|\\|C' and 'A|B|\|C'  as read from a file really
cannot be distinguished because 'escape processing' cannot be suppressed in a
local context,  making them  'Really the same' strings.  This means that Perl is
inadequate for this parsing task.

Obviously, outside of Perl these are NOT the same strings, but when read by Perl
they become the same - and that can't be stopped.  Input comes from files that I
do not create, so this is not a matter of saying that this input should contain
additional backslashes.

Guess I'll have to call out to another program to provide some input stream
pre-processing support.  I was hoping to avoid that.

Carl


>> To illustrate the problem, the strings below are not distinguished, and
>> I haven't been able to find a way to distinguish them because interpolation
>> of '\\' hits before I can do anything.  Is there any way to turn off
>> interpolation in a local context?
>
>No, but there is no interpolation here.  You mean 'escape processing'.
>
>> # Sample showing failure to distinguish strings - these produce
>> # the same results:
>> printf "length %d %s %s\n",length('A|\|C|'),'A|\|C|',quotemeta('A|\|C|');
>> printf "length %d %s %s\n",length('A|\\|C|'),'A|\|C|',quotemeta('A|\\|C|');
>
>They produce the same results because they are the same strings.  Really 
>the same.  In single-quoted context, either \ (not followed by a single-
>quote) or \\ produce a single backslash.
>
>To get two backslashes into a string (either single- or double-quoted), 
>you must use four (\\\\).

This  data comes from database dump files I don't create.  And I don't think
this helps anyways.

According to the syntax of these files, '\\' pairwise left-right turns into
literal '\' characters, and '\|' is treated as a literal vertical bar, but an
unescape '|' is treated as a field separator.  I need to distinguish
real field-separators from literal vertical bars, which is complicated by
the presence of some fields containing only a 'literal' backslash, in the
escaped form of '\\'.  Fields can contain whitespace and they may be null too.

>
>> What is desirable is when splitting (these are being read from a file) is to get
>> the following splits:
>> 'A|\|C|'  splits into ('A','\|C')          (2 components)
>> 'A|\\|C|'  splits into ('A','\\','C')     (3 components)
>> 
>> Now how can that be done within Perl given that these two strings
>> appear so fundamentally  indistinguishable?
>
>I couldn't do it with split(), but here's a regex solution:
>
>
>#!/usr/local/bin/perl -w
>#use strict;
>
>print join('+' =>
>
>  /(           # start capture
>    (?:        #   a sequence of either
>      \\[\\|]  #     an escaped backslash or vertical bar
>    |          #   or
>      [^|]     #     any character except vertical bar
>    )+         #   don't allow fields to be empty
>   )           # end capture
>  /gx), "\n"
>
>for qw( A|\|C A|\\\\|C );
>
>__END__
>
>Output:
>
>A+\|C
>A+\\+C

This does not solve the problem I posed - you changed the problem by adding an
extra backslash..  It does not distinguish input strings 'A|\|C|' from 'A|\\|C|'
by parsing them differently.

>
>-- 
>(Just Another Larry) Rosler
>Hewlett-Packard Laboratories
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com

Carl

Antispam address:  In order to reply, change NoSpam to tiac.


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

Date: Sat, 21 Aug 1999 12:42:44 +0200
From: "Juan Riera" <jriera@retemail.es>
Subject: How to print a date in ISO week # format
Message-Id: <7pm0ea$9fu1@SGI3651ef0>

Hello,
I have a table created in MS Access as Time/Date and exported to MySQL,
afterwards I delete it from Access and vincule again to MySQL, so it retains
time/date format.
I need to format output to a CGI perl script as #week ISO  (first week of
the year is the week with four or more days on it, or the first week with
thursday on it). MySQL has a week formatting option that formats dates as
week number, i.e. week #1 is the week with 1st of January on it, and this is
not what I need.
On Access I get this formatting using the FORMAT VB function, as I can use
it on SQL Access call.
Do you know any way to do it on perl?

Thanks,
Juan






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

Date: Sat, 21 Aug 1999 06:18:22 -0700
From: moseley@best.com (Bill Moseley)
Subject: killing my child
Message-Id: <MPG.122846fcc0a31d749896cb@nntp1.ba.best.com>

open (PIPE, "$command_line|") || die $!;

Do I need to do anything else besides close( PIPE ) if I want to 
properly kill the program before I've read all its output?

There's a paragraph in perlipc about setting $SIG{CHLD} but I'm unclear 
if that applies here.  And perlipc also says the above open is better 
than backticks because it lets me 'kill off the child process early.'  
But then I don't see where it explicitly says how.

Thanks,

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


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

Date: Fri, 20 Aug 1999 15:10:29 -0400
From: -Sneex- <bill@fccj.org>
To: perl-users@ruby.oce.orst.edu
Subject: Re: Message-ID vs. Reference Header
Message-Id: <200819991510293244%bill@fccj.org>
Keywords: dss sneex

[[ This message was both posted and mailed: see
   the "To," "Cc," and "Newsgroups" headers for details. ]]

> Date: 20 Aug 1999 09:39:23 -0500
> From: abigail@delanet.com (Abigail)
> Subject: Re: Message-ID vs. Reference Header
> Message-Id: <slrn7rqq6l.bq6.abigail@alexandra.delanet.com>
> 
> Bill Jones (bill@fccj.org) wrote on MMCLXXVI September MCMXCIII in
> <URL:news:199908161211.IAA23961@astro.fccj.cc.fl.us>:
> 
> 
> No.
> 
> The Message-ID is a single ID, identifying your posting. The References
> header is a list of IDs, identifying the postings you are referencing.
> 
> The same ID should not appear in both headers. And Message-ID isn't a
> substitute for the References line either.


I agree. :]  Scary huh?

After a lot of research I believe that I will not be 
able to post to a 'threaded' discussion via a mail gateway.

I can create NEW threads anytime - but not actually to reply to a
thread.  Not unless the orginal poster was kind enough to publish the
original References line as you have done.


Any thoughts?  Anybody?

Thx,
-Sneex-  :]

--------------------------------------------------------------
The (partial) HEADERS as found by my disfunctional news server:

From: abigail@delanet.com (Abigail)
Newsgroups: comp.lang.perl.misc
Subject: Re: Message-ID vs. Reference Header
References: <199908161211.IAA23961@astro.fccj.cc.fl.us>


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

Date: Sat, 21 Aug 1999 05:15:52 -0400
From: Wael Hassan <whassan@cs.concordia.ca>
Subject: Running and executable file from Perl
Message-Id: <37BE6E48.CB92917D@cs.concordia.ca>

Hi,
This is an extension to an earlier message I sent.
Machine:      I am using Linux Box  2.0.35 #57 Tue Oct 13 23:02:53 CDT
1998 i686 unknown
Perl Verion: This is perl, version 5.005_02 built for i586-linux
--------------------------------------------

$rc = 0xffff & system("/data1/Blast/blastall", "-pblastx","-ii.txt",
"-d/data1/DB/NR/nr.nt", "-op.txt")  == 0 or
    die "Call to search function failed";
#   exec "/data1/Blast/blastall -pblastx -ii.txt -d/data1/DB/NR/nr.nt
-op.txt ";
#I am trying to test either exec or system
#   $y= exec ("ls");

    printf " system() returned %#04x: ",  "$rc";
    print "<br>";
    print  "-=------------\n\n";
    if ($rc == 0 ){
 printf "Run With Normal Exit\n";
    }
    elsif ($rc == 0xff00) {
 print "Command failed: $!\n";
    }
    elsif (($rc ==0xff) ==0) {
 $rc >>= 8;
 print "ran with non-zero exit status $rc \n";
    }
    else {
 print "ran with";
 if ($rc & 0x80){
     $rc &= ~0x80;
     print "coredump from";
 }
 print "signal $rc\n"
 }
  $ok = ($rc ==0);
--------------
Partial Output  When I ran it in the  Linux shell


system( ) returned 0x01: <br>ran with non-zero exit status 0
<br><br><br><hr>
</body>
----------------
When it is in the web page, I see this

system() returned 0x01:
ran with non-zero exit status 0
----------------
That run is supposed to produce an output file.
When I run it from the shell, it does what it is supposed to.
On the other hand, from the web page, it does not work.

Thanks
Wael Hassan



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

Date: Sat, 21 Aug 1999 05:28:23 -0400
From: Wael Hassan <whassan@cs.concordia.ca>
Subject: Re: Running and executable file from Perl
Message-Id: <37BE7137.7BD31B60@cs.concordia.ca>

Hi,
I found the solution 2 seconds after I did the posting.
This is my interpretation.

The web server is not allowed to create files in the  cgi-bin
directory so I changed the output of the program to /tmp/p.txt
instead of .../cgi-bin/p.txt

It worked

Thanks Any Ways
wael

Wael Hassan wrote:

> Hi,
> This is an extension to an earlier message I sent.
> Machine:      I am using Linux Box  2.0.35 #57 Tue Oct 13 23:02:53 CDT
> 1998 i686 unknown
> Perl Verion: This is perl, version 5.005_02 built for i586-linux
> --------------------------------------------
>
> $rc = 0xffff & system("/data1/Blast/blastall", "-pblastx","-ii.txt",
> "-d/data1/DB/NR/nr.nt", "-op.txt")  == 0 or
>     die "Call to search function failed";
> #   exec "/data1/Blast/blastall -pblastx -ii.txt -d/data1/DB/NR/nr.nt
> -op.txt ";
> #I am trying to test either exec or system
> #   $y= exec ("ls");
>
>     printf " system() returned %#04x: ",  "$rc";
>     print "<br>";
>     print  "-=------------\n\n";
>     if ($rc == 0 ){
>  printf "Run With Normal Exit\n";
>     }
>     elsif ($rc == 0xff00) {
>  print "Command failed: $!\n";
>     }
>     elsif (($rc ==0xff) ==0) {
>  $rc >>= 8;
>  print "ran with non-zero exit status $rc \n";
>     }
>     else {
>  print "ran with";
>  if ($rc & 0x80){
>      $rc &= ~0x80;
>      print "coredump from";
>  }
>  print "signal $rc\n"
>  }
>   $ok = ($rc ==0);
> --------------
> Partial Output  When I ran it in the  Linux shell
>
> system( ) returned 0x01: <br>ran with non-zero exit status 0
> <br><br><br><hr>
> </body>
> ----------------
> When it is in the web page, I see this
>
> system() returned 0x01:
> ran with non-zero exit status 0
> ----------------
> That run is supposed to produce an output file.
> When I run it from the shell, it does what it is supposed to.
> On the other hand, from the web page, it does not work.
>
> Thanks
> Wael Hassan





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

Date: Sat, 21 Aug 1999 12:06:26 +0200
From: "Magnus Hult" <hult.holmstrom@swipnet.se>
Subject: Running CGI scripts on my PC
Message-Id: <LRuv3.6701$7d.13544@nntpserver.swip.net>

Hello,

to compile/interpret Perl on W95 I was recommended ActivePerl. The reason
why I wanted to write Perl was to run CGI scripts on my own computer to
check if they were all right before sending them to my Apache server.

But when compiling at home, I got some problems. The first is that the line:
print "Content-type: text/html\n\n";
gets printed out on the resulting page instead of in the file header. Very
strange. The second is that I'd like the result of the compile to be shown
in my browser instead of as HTML on a DOS screen. And third, how do I send
arguments to the script?
I know that script.cgi?var=value won't work because Windows doesn't allow
question marks in paths. But how do I do?

Maybe ActivePerl isn't the right program for me?

Thank you,
Magnus Hult
hult.holmstrom@swipnet.se




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

Date: Sat, 21 Aug 1999 12:00:19 GMT
From: Floyd Morrissette <Webdesigner@NewWebSite.com>
Subject: Re: Running CGI scripts on my PC
Message-Id: <7pm4ch$g59$1@nnrp1.deja.com>

In article <LRuv3.6701$7d.13544@nntpserver.swip.net>,
  "Magnus Hult" <hult.holmstrom@swipnet.se> wrote:
> Hello,

>
> But when compiling at home, I got some problems. The first is that the
line:
> print "Content-type: text/html\n\n";
> gets printed out on the resulting page instead of in the file header.
Very
> strange. The second is that I'd like the result of the compile to be
shown
> in my browser instead of as HTML on a DOS screen. And third, how do I
send
> arguments to the script?
> I know that script.cgi?var=value won't work because Windows doesn't
allow
> question marks in paths. But how do I do?
>
> Maybe ActivePerl isn't the right program for me?
>
> Thank you,
> Magnus Hult
> hult.holmstrom@swipnet.se


Active Perl is right and you must be running a webserver like Apache.
After everything is installed properly you can call the script via your
web browser and yes you can do something like script.cgi?var=value

--
Get your web site from http://www.NewWebSite.com
Consultation is always free.
Help with cgi scripts.


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


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

Date: Sat, 21 Aug 1999 06:03:50 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Time as per IST??
Message-Id: <MPG.1228439212edabcf9896ca@nntp1.ba.best.com>

Sreshth Kumar (skumar@deutech.com) seems to say...
> Suppose I want to display all times according to IST (GMT + 5:30) the
> easiest way to do it would be to add 5 hours and 30 minutes to the time
> returned by gmtime(). How do I do this?
> 
> Or for that matter how does one increment / decrement time by a given number
> of hours/minutes/seconds?

Seems like addition and subtractions is what you want.  Read perldoc -f 
gmtime again and see what it says to use as input.

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


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

Date: Sat, 21 Aug 1999 16:37:40 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Time as per IST??
Message-Id: <Pine.HPP.3.95a.990821162104.933B-100000@hpplus03.cern.ch>

On Sat, 21 Aug 1999, Sreshth Kumar wrote:

> Suppose I want to display all times according to IST (GMT + 5:30) the
> easiest way to do it would be to add 5 hours and 30 minutes to the time
> returned by gmtime().

I think the _easiest_ way would be to run the affected software
in an environment that had TZ set to the appropriate value.

perldoc perlfaq8 "How do I set the time and date?" includes this
answer.

man 3 timezone may be helpful in explaining what settings of TZ are
appropriate on the OS that you use (I'm assuming a unix-like OS).

> Or for that matter how does one increment / decrement time by a given number
> of hours/minutes/seconds?

If daylight saving time issues aren't involved, and you don't mind it
failing in around the year 2035 or so, then you've just given the answer
in your question, I think.  perldoc -f for time, localtime and gmtime
seem to me to be instructive.



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

Date: 21 Aug 1999 01:37:41 PST
From: Neil <neil@pacifier.com>
Subject: vacation doesn't work with domain name. Alternative in Perl?
Message-Id: <37be6555.0@news.pacifier.com>

I wanted to use the unix utility "vacation".

It works fine when used with just a login name:

\login, "|/usr/bin/vacation login"

However, when I try to use an alias (involving a domain name) it
does not work:

\login, "|/usr/bin/vacation -a user@domain.com login"


I asked my ISP and they say that vacation will not work with aliases
involving a domain name. They recommended I use a procmail script but
that I should be very careful.

Could someone tell me how I can create roughly the equivalent of vacation
using procmail or, better yet, does anyone know of a Perl script that acts
like vacation (but better!)? Thanks.

Neil


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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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