[12751] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 161 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 16 01:07:12 1999

Date: Thu, 15 Jul 1999 22:05:12 -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           Thu, 15 Jul 1999     Volume: 9 Number: 161

Today's topics:
        $50 for solution to this perl/mail problem newsmf@bigfoot.com
    Re: About "reverse" command <uri@sysarch.com>
    Re: About "reverse" command (Abigail)
    Re: About "reverse" command (Larry Rosler)
    Re: About "reverse" command (Ronald J Kimball)
    Re: C-like #define macros in Perl (Abigail)
    Re: CGI with Postscript? (Anno Siegel)
        CGI.pm: $q->start_html(-target=> not working?! (Martin Brown)
    Re: CGI.pm: $q->start_html(-target=> not working?! <jeffp@crusoe.net>
    Re: CGI.pm: $q->start_html(-target=> not working?! <cs2400@hotmail.com>
        DBI problem with MS Access <lynn@swcp.com>
    Re: dns admin (Michael Fuhr)
    Re: file to array ? (Abigail)
    Re: Future of Perl (Abigail)
    Re: generate the return html for browser client (Abigail)
        Get Time , Less Than a second (Ryan Ngi)
    Re: Get Time , Less Than a second <jeffp@crusoe.net>
    Re: getting the virtual host info... (Abigail)
    Re: Help with cgi cookie (Abigail)
    Re: How should I sort by different fields? (Abigail)
        loop problems ?? stu7@usa.net
    Re: loop problems ?? <uri@sysarch.com>
    Re: My Foot Hurts (Tad McClellan)
    Re: ok, DBI alt row colors - phrased better w/code (Ronald J Kimball)
    Re: Perl Programmer Wanted ASAP - Great Rates $$$ (Ronald J Kimball)
    Re: Perlscript calling VBScript function chris@loafer.worldhq.org
    Re: plist parsing (Anno Siegel)
    Re: regexp in substr? (Abigail)
    Re: regular expression (Larry Rosler)
    Re: Sending Attachments with email <elaine@chaos.wustl.edu>
        set up hash using variables not yet defined (Christian M. Aranda)
    Re: Test if a File Exists? (Charles DeRykus)
        Why we can't do this !? (Ryan Ngi)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 16 Jul 1999 03:51:05 GMT
From: newsmf@bigfoot.com
Subject: $50 for solution to this perl/mail problem
Message-Id: <7mma76$43a$1@nnrp1.deja.com>

Hi -
whoever sends me a solution to this first, gets a $50 Citibank check in
the mail. Thanks a lot for your help.

$text contains the html of a web page.

I need a perl rountine that sends $text

a) viewable within an email or
b) as an attachment to an email.

both options should be available.

I've already written a routine myself (see below), but the main problem
seems to be that Sendmail truncates lines that are two long. Where those
breaks fall into Javascript, pages causes display errors for the people
who receive them as email.

In case you want to refer me to MIME:LITE, please write out the whole
routine using MIME:LITE. Knowing this lead already, I've been too clumsy
getting this to work.

As always, I'll post the winner's name to this group.

Please send your solutions to newsmf@bigfootNOSPAM.com beside posting
them here.

Cheers,

Marc.


my routine:

$text = $_[0];
#@file = split (/\n/,$text);


@file = unpack "a25 a25" x int(length($text)/25), $text;



#$SENDMAIL='/bin/sendmail';  # This is the location of the
$SENDMAIL='/usr/sbin/sendmail';  # This is the location of the

                                # sendmail program on your system


if ($htmldelivery ne "ON") {

open (MAIL, "| $SENDMAIL $email");


print MAIL "Reply-to: emailservice\@blabla.com\n";
print MAIL "From: emailservice\@blabla.com\n";
print MAIL "To: $email\n";
print MAIL "Content-Type: text/html\n";
print MAIL "Subject: qb: $title\n\n";
print MAIL "<html><head><title>$title</title></head>";
print MAIL "$text";
print MAIL "</html>";
close MAIL;

} else

{

$attachmentname = "qb".$timestamp.".html";
$content_type = "text/plain; charset=\"us-ascii\"";


# open (MAIL, "| $SENDMAIL $email");

open (MAIL, "| $SENDMAIL $email") ||  die ("$0:  Fatal Error!  Cannot
open sendmail:: $!\n");

 print MAIL "Reply-to : emailservice\@blabla.com\n" ;
 print MAIL "From: emailservice\@blabla.com\n";
 print MAIL "To: $email\n";
    print MAIL "Subject : qb: $title\n" ;
    print MAIL "MIME-Version : 1.0\n" ;
    print MAIL
      "Content-Type : multipart/mixed; "
      ."boundary=\"======================_888227034==_\"\n\n" ;
    print MAIL "This is a multi-part message in MIME format.\n" ;
    print MAIL "--======================_888227034==_\n" ;
    print MAIL "Content-Type : text/plain; charset=us-ascii" ;
    print MAIL "\n\n" ;
    print MAIL "Your requested Page \"$title\"\n\n\n\n" ;
    print MAIL "--======================_888227034==_\n" ;
    print MAIL "Content-Type : $content_type\n" ;
    print MAIL "Content-Disposition: attachment;".
      "filename=\"$attachmentname\"\n\n" ;

    print MAIL "<html><head><title>$title</title></head>" ;
    print MAIL "$text" ;
    print MAIL "</html>" ;
    print MAIL "\n\n\n\n" ;
    print MAIL "--======================_888227034==_--\n\n" ;


close MAIL;


} # end else


}


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


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

Date: 15 Jul 1999 23:12:45 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: About "reverse" command
Message-Id: <x7673lmgnm.fsf@home.sysarch.com>

>>>>> "s" == scientiaXXX  <scientiaXXX@XXXtechnologist.com> writes:

  s> $a="one.two.three.four.five.six";
  s> @arr=split(/\./,$a);
  s> reverse(@arr);

reverse does not modify its input. try assigning it to something.

and rtfm.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 15 Jul 1999 22:34:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: About "reverse" command
Message-Id: <slrn7ota0m.c9j.abigail@alexandra.delanet.com>

scientiaXXX (scientiaXXX@XXXtechnologist.com) wrote on MMCXLV September
MCMXCIII in <URL:news:378EDC4A.DE@XXXtechnologist.com>:
%% 
%% #!/usr/bin/perl
%% print "Content-type:text/html\n\n";
%% $a="one.two.three.four.five.six";
%% @arr=split(/\./,$a);
%% reverse(@arr);
%% print "$arr[0]<br>\n";
%% print "$arr[1]<br>\n";
%% print "$arr[2]<br>\n";
%% 
%% It should write
%% six
%% five
%% four
%% but it writes
%% one
%% two
%% three
%% If I delete the line with reverse(@arr), the result is the same.


Indeed. And I very much would like to see the perl where the above
code works as you think it would. Because that version of perl 
contains a serious bug.

Did you read the manual about reverse()? And note that if you had
run the program with the -w switch, Perl would have warned you, and
you wouldn't have had to ask here!



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


  -----------== 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: Thu, 15 Jul 1999 20:27:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: About "reverse" command
Message-Id: <MPG.11f8466a8a652da4989ce1@nntp.hpl.hp.com>

In article <378EDC4A.DE@XXXtechnologist.com> on Fri, 16 Jul 1999 
00:16:26 -0700, scientiaXXX <scientiaXXX@XXXtechnologist.com> says...
 ...
> @arr=split(/\./,$a);
> reverse(@arr);
 ...
> If I delete the line with reverse(@arr), the result is the same.

That's because reverse() produces a reversed list as its value, but 
you're not storing it.  It doesn't change the input (which might be a 
list, not an array, after all).

  @arr = reverse @arr;

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


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

Date: Fri, 16 Jul 1999 00:34:02 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: About "reverse" command
Message-Id: <1dv0ccc.1u6dj45au18aoN@p113.tc1.metro.ma.tiac.com>

scientiaXXX <scientiaXXX@XXXtechnologist.com> wrote:

> reverse(@arr);

> If I delete the line with reverse(@arr), the result is the same.

reverse() does not work in-place.  As the documentation explains, it
_returns_ the result of the reversal.  You have to actually assign that
to something.

@arr = reverse(@arr);

-- 
chipmunk (Ronald J Kimball) <rjk@linguist.dartmouth.edu>
perl -e 'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-


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

Date: 15 Jul 1999 22:27:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: C-like #define macros in Perl
Message-Id: <slrn7ot9ji.c9j.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCXLV September MCMXCIII in
<URL:news:x7g12pmjmb.fsf@home.sysarch.com>:
&& >>>>> "A" == Abigail  <abigail@delanet.com> writes:
&& 
&&   A> Well, access to deja isn't forbidden, but access to the keyboard is.
&&   A> And there's no mouse.
&& 
&& yes there is. it is that footpedal on the floor. and your pc probably
&& has this neat motorized coffee cup holder too.

I haven't seen footpedals, but I can place cups on the computer by taking
one of those square coasters (someone called them "disks" hihihihihihi)
halfway in one of those slits, and balance the cup on it.

&& do i have to post that use of -P here?

No, you don't have to. You can, if you wish. You can email it as well.
Just do whatever you want; just don't be off topic.


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== 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: 16 Jul 1999 04:12:39 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: CGI with Postscript?
Message-Id: <7mmbfn$hd3$1@lublin.zrz.tu-berlin.de>

Kyoil Kim  <kikim@cerc.utexas.edu> wrote in comp.lang.perl.misc:
>I executed the following cgi program, which shows simple ps file in a
>web browser, but I got an error message
>"the document contains no data". I don't know why. The codes are exactly
>same with the one in the O'Reilly &

Probably too exactly the same.

>Associates's book, CGI programming. Please let me know what the problem
>is. Thanks.
>The codes are as follows.
>=====================================================================
>
>#!/usr/local/bin/perl
>
>$GS = "usr/local/bin/gs";

[snip]

You have checked that gs is in /usr/local/bin on your server, haven't
you?

Anno


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

Date: 15 Jul 1999 21:01:33 -0700
From: mjbjr@best.com (Martin Brown)
Subject: CGI.pm: $q->start_html(-target=> not working?!
Message-Id: <7mmaqt$pog$1@shell9.ba.best.com>

I have a login form, which 'POST's to a cgi script which will load a
navigation bar (cgi created html) into the target "nav frame", but loads
it instead into another frame.

I'll be damned if I can figure out what's wrong.  MY code seems to be just
like the code in the docs (cgi.pm html manual):

manual shows:

A -target parameter, if you want to have all links and fill out forms on
the page go to a different frame. Example: 

            print $query->start_html(-title=>'Secrets of the Pyramids',
                                     -target=>'answer_frame');

my code:

   # object oriented style
   print $query->header(),
      $query->start_html(-target=>'my_dex_nav_frame'),
      $query->p,
      'There has been a successful login',
      $query->p,      
      $query->end_html;


the result is:

    There has been a successful login

is printed not in the target frame, but in the frame from which the the
original form resided.  And yes there is a frame named "my_dex_nav_frame".

Ideas?

Thanx.                             
-- 

                           - Martin J. Brown, Jr. -

                             - BEAUDESIGN.COM -


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

Date: Fri, 16 Jul 1999 00:20:17 -0400
From: evil Japh <jeffp@crusoe.net>
Subject: Re: CGI.pm: $q->start_html(-target=> not working?!
Message-Id: <Pine.GSO.4.10.9907160018510.2982-100000@crusoe.crusoe.net>

> A -target parameter, if you want to have all links and fill out forms on
> the page go to a different frame. Example: 

Upon reading the CGI.pm docs, you find that the -target parameter creates
a <base target="..."> tag, for the frame to which links go, if no
target="..." parameter is given in the <a> tag.

From the docs:

       The argument -target allows you to provide a default
       target frame for all the links and fill-out forms on the
       page.  See the Netscape documentation on frames for
       details of how to manipulate this.


-- 
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp

Crusoe Communications, Inc.
732-728-9800
www.crusoe.net



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

Date: Fri, 16 Jul 1999 00:19:44 -0400
From: "c.s." <cs2400@hotmail.com>
Subject: Re: CGI.pm: $q->start_html(-target=> not working?!
Message-Id: <932098861.269.4@news.remarQ.com>

Have you looked at the generated HTML code to ensure that the <form>
tag has the right "target" attrib?

--




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

Date: Thu, 15 Jul 1999 21:42:03 -0600
From: "Lynn" <lynn@swcp.com>
Subject: DBI problem with MS Access
Message-Id: <7mm9qr$hqu$1@sloth.swcp.com>

I connect to an ODBC access database and everything works as expected until
I try to perform a SELECT from a keyfield that has a 'Autonumber' data type.
All other data type seem to work -- it's only the autonumber fields that
fail.  The code is similiar to what I show below:

my $sql  = qq( SELECT field FROM table WHERE keyfield = ?);
my $SelectMCRDetails = $dbh->prepare($sql) || die "Prepare: $dbh->errstr\a";

$SelectMCRDetails->execute($id) || die "\ablah blah blahl: ", $dbh->errstr;

The error message is:
Data type mismatch in criteria expression. (SQL-22005)(DBD:
st_execute/SQLExecute err=-1) at D2Kmcr.pl line...

I've tried forcing the $id into a number and a string and still no success.
Does anyone know how to SELECT using an autonumber?

Thanks.

lynn@swcp.com





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

Date: 15 Jul 1999 21:19:43 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: dns admin
Message-Id: <7mm8cf$rh3@flatland.dimensional.com>

"Volker Bertsch" <uncw@rz.uni-karlsruhe.de> writes:

> are there any scripts/modules to admin a dns-server (bind8)? I need it for
> web-based interface to configure dns.

See the Comprehensive Perl Archive Network (CPAN):

http://www.perl.com/CPAN/
http://www.cpan.org/

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Date: 15 Jul 1999 23:00:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: file to array ?
Message-Id: <slrn7otbig.c9j.abigail@alexandra.delanet.com>

stu7@usa.net (stu7@usa.net) wrote on MMCXLIV September MCMXCIII in
<URL:news:7mjdjm$1vf$1@nnrp1.deja.com>:
||   Is there a single PERL function which writes a file (by line)
|| to an array ?


Yes.

And guess what. There's a place in the manual that documents it.



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


  -----------== 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: 15 Jul 1999 23:24:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Future of Perl
Message-Id: <slrn7otcu4.c9j.abigail@alexandra.delanet.com>

Jeffrey (Jeffrey@ix.netcom.com) wrote on MMCXLIV September MCMXCIII in
<URL:news:3795bd45.37232960@news.giganews.com>:
^^ 
^^ How long is Perl going to be around?

Till May 19, 2001. That's when the license that NASA granted Larry expires.
*All* perl binaries have a self destruct function that test the date, and
erase Perl and any Perl programs from your hard disk if you start Perl after
May 19, 2001.

^^                                      I want to know if I'm wasting my
^^ time learning it.

Yes. Don't bother learning it. Even if Perl would be around after May 19,
2001, learning a new langauge is often a waste of time. After all, the 
language might suddenly no longer be around, and all your programs stop
working. That's why there's no Cobol code around anymore; all Cobol code
was replaced by C in the early '70s.

^^                   Some say Java will replace Perl.

Oh yes. Java will rapidly replace Perl. After all, Java is crossplatform,
backwards compatible between versions, open source, and mainly, it isn't
hyped, were Perl is. Java is the true glue language of the future, with
it's abilities to interact with the environment - something that's missing
in Perl. And Java's buildin hashes and its regex capabilities outshine Perl.

^^                                                    I don't see how
^^ that can happen when Java is so bloody slow and such a memory hog.

Memory is cheap. And remember Moore!

^^ Some say PHP3 is better. Then why hasn't it taken over yet?

Oh, it has, it has. It's just there, lurking in the shadows, posing
as something else. On my system, I've PHP3 identified as posing as
/dev/null.

^^                                                             I just
^^ don't want to spend time learning something that's going to be of no
^^ marketable value in the near future.


Don't judge programming languages on their usefullness, judge them on
their marketable value! That'll increase the quality of code and will
bring us closer to world peace.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== 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: 15 Jul 1999 23:31:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: generate the return html for browser client
Message-Id: <slrn7otdcj.c9j.abigail@alexandra.delanet.com>

Thien Syh (gabriel@asiaep.com) wrote on MMCXLIV September MCMXCIII in
<URL:news:7mjes2$2bq$1@nnrp1.deja.com>:
`` I'm facing a problem on my perl program , when i compile the program it
`` gave me the following error message:
`` content-type:texthtml

Uhm, could you first try to figure out what a program is, what your
program is supposed to do, how it interacts with its environment,
and what "compiling" means for Perl? Then you might be able to ask
a sensible question.

`` ### generate the return html for browser
`` client                               _
`` print("content-
`` type:text/html\n\n");                                          _
`` print("<html><head><title>Merchant Administration
`` Page</title></head>\n");    _
`` print("<CENTER><font face=\"helvetica\"><B>EDC Merchant
`` Administration</B></ce_
`` ###


That doesn't even compile.


Abigail
-- 
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
          for (??;(??)x??;??)
              {??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'


  -----------== 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: Fri, 16 Jul 1999 01:21:02 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: Get Time , Less Than a second
Message-Id: <378e8798.7320295@news.inet.co.th>

i want to see that which each takes longer time between alogrithm #1
and algorithm #2..... i use this;


$x=time;

### Algor 1

print "1 ",time-$x;

$x=time;

### Algor 2

print "2 ",time-$x;

but the two algorithms take time less than a second that the variable
"time" is not suitable...... how to fix this!!!


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

Date: Fri, 16 Jul 1999 00:18:22 -0400
From: evil Japh <jeffp@crusoe.net>
Subject: Re: Get Time , Less Than a second
Message-Id: <Pine.GSO.4.10.9907160017310.2982-100000@crusoe.crusoe.net>

> but the two algorithms take time less than a second that the variable
> "time" is not suitable...... how to fix this!!!

use the Benchmark module.

# code example

use Benchmark;

timethese(10_000, {
	'meth1' => q{ BLOCK OF CODE },
	'meth2' => q{ BLOCK OF CODE },
});

-- 
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp

Crusoe Communications, Inc.
732-728-9800
www.crusoe.net



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

Date: 15 Jul 1999 23:44:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: getting the virtual host info...
Message-Id: <slrn7ote55.c9j.abigail@alexandra.delanet.com>

Paul Leduc (pleduc@ca.ibm.com) wrote on MMCXLIII September MCMXCIII in
<URL:news:378C9169.A9C976BE@ca.ibm.com>:
&& I am writing a script to do some form processing, and when complete, I
&& am trying to display a 'thank you' html page.  The problem is I want the
&& code to work in both our test or staging environment as well as our
&& production environment.

That's a problem? In our company, code that works in test, stage and
production is a _requirement_, not a problem.

&& I am using the following:
&& print $q->redirect($q->protocol() . '://' . $q->virtual_host() .
&& $done_url);
&& 
&& however, $q->virtual_host() gives the same value (www.xxx.com)
&& regardless of whether I am running it from http://www.xxx.com   or
&& http://www.xxx.com:81 (our staging server).

But, but, but, the other x is different!  Why do you expect 'www.xxx.com'
and 'www.xxx.com' to be different?

&& Am I doing this correctly, or is there a better way?

I don't see a problem, except that this is better asked in a different
group.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== 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: 16 Jul 1999 00:00:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with cgi cookie
Message-Id: <slrn7otf1p.c9j.abigail@alexandra.delanet.com>

rn7532@bris.ac.uk (rn7532@bris.ac.uk) wrote on MMCXLIII September
MCMXCIII in <URL:news:7mimu8$p31$1@nnrp1.deja.com>:
;; Is there away of using a cgi to remember the details a person enters in a
;; form (name, address, etc) so that when they return at a later date this
;; info will automatically be filled in? Is there a java script that would
;; better handle this? I am fairly new to back end programming. Any help and
;; ideas are greatly appreciated.


No. HTTP is stateless. You might have some success with cookies some of
the time, but it'll fail when you least expect it. Cookies, if returned
by the browser at all, at best identify a browser, not a person. The
same person going to your site from a different computer will not be
regarded as "to return", while another person using the first browser
of the previous person will be regarded as "to return".


Of course, this has as little to do with Perl as growing string beans
has to do with Perl. So, followups set.




Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";


  -----------== 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: 15 Jul 1999 22:39:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How should I sort by different fields?
Message-Id: <slrn7otaak.c9j.abigail@alexandra.delanet.com>

Jordan Hiller (hiller@email.com) wrote on MMCXLV September MCMXCIII in
<URL:news:378E7AB8.D006722F@email.com>:
() 
() But, it must also be able to sort by any column before it makes the HTML tabl
() I've read the docs on sort and I understand how to use it for a simple array,
() but I'm not sure what to do here. I'm not even sure how to lay out my data
() structure. Can someone give me a bit of help?


FAQ.


Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== 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: Fri, 16 Jul 1999 03:03:41 GMT
From: stu7@usa.net
Subject: loop problems ??
Message-Id: <7mm7e8$35q$1@nnrp1.deja.com>



  Ive had the same(?) problem with two short scripts... both of them
work alone, but when written inside a loop, either fail completely,
or give different output than expected.

  $this = "that"; print "$this is the word" // works fine by itself

but inside an if loop, prints  that (on one line), and then
prints everything else on a second line... still printing, but
why the new line ??

  Is there a standard way to protect "$this" type values inside loops ?

(btw...the other script also runs fine, but wont exit correctly when
 a loop is included inside)

  Maybe some PERL manpage discusses special treatment of print
statements inside loops ??


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


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

Date: 15 Jul 1999 23:16:08 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: loop problems ??
Message-Id: <x73dypmghz.fsf@home.sysarch.com>

>>>>> "s" == stu7  <stu7@usa.net> writes:


  s>   $this = "that"; print "$this is the word" // works fine by itself

  s> (btw...the other script also runs fine, but wont exit correctly when
  s>  a loop is included inside)

  s>   Maybe some PERL manpage discusses special treatment of print
  s> statements inside loops ??

i might help if you show the full code with the loop? how could we
divine the answer to the problem without proper info. did you think the
line above which works is useful by itself?

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Thu, 15 Jul 1999 19:01:00 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: My Foot Hurts
Message-Id: <c7plm7.4pm.ln@magna.metronet.com>

Don Coyote (Coyote@shambolica.freeserve.co.uk) wrote:

: My left foot hurts, I've read the FAQ and tried switches -t & -w but
: nothing seems to work.


   Well you ignorant patoot!


   It clearly says

      if (strcmp(rfoot, "pain") == 0) {     # relieve the discomfort
                 ^
                 ^

   deep in the bowels of the source code somewhere (I forgot where, 
   exactly.  Umm...  I think I have also forgotten _what_ the source
   that I saw was for, but it might have been for perl. But maybe
   it was something else. Anyway, I saw it once and you are an
   idiot for not having seen it somewhere too.)

   So there!


   I don't think it says anywhere in the Standard Docs about only
   working on right feet, but I'm not letting a simple thing like 
   that get in the way of my righteously angry followup.

   I saw on the p11p list (I think) that there might be a warning 
   for that in future releases (but, like I said, future releases 
   of _which_ program is currently indeterminate). 

   And besides, you can just turn warnings back off if they 
   are bothersome.
   
   That's what most people do.



   So, the answer to your silly question:

      perl (or maybe some other program, like I said) can only
      help with *right* foot pain.

      The solution is simple however.

      Stand backwards when running perl so that it will direct its
      efforts at the desired pedal (if you wear glasses, flip those
      around to the back of your head too).

      I haven't tried it, but reverse() could maybe work too...



   And boy are you lucky I could answer your question with the
   scant diagnostic information that you provided!

   It is customary to include a small, yet complete, snippet
   of your source foot (and use cut/paste, don't try to
   recreate it (that is not approved for humans yet, 
   I don't think)).

   Oh yeah, and a description of what you expected the foot to do
   and what it is doing instead.

   Oh yeah, oh yeah, and how much the job pays.

   And.. er... um... lots of Other Stuff that wasn't in your post.

   You should monitor the

      news.announce.newlusers               # s/l//;

   newsgroup for a while to discover the social aspects pertaining
   to discussing feet in public before just barging in here
   with it, you know.

   There might be digits around you know...



: BTW, I did buy a cheap pair of shoes 


   Shoes?

   Shoes!?

      s/shoes/sun glasses/;   # zzt


: a few days ago and have done a lot
: of walking in them 


   Ahhh, but was it sunny outside?

   Maybe _that's_ the root cause of the problem?

   I dunno 'cause I'm only on day 3 of 21 in My Book.

   I'll come back and followup to this in 18 days, so just
   hang on until then!
   

: but I can't see how that relates to Perl?


   It has nothing to do with Perl (unless you were humming the
   Perl Theme Song while walking).

   Ya know... Now I am beginning to think maybe it _was_ some other 
   source code where I saw that.

   Anyway, you can just do a Web search and find it (and other
   stuff too, I hear).


      What I said before about patoot and all?

      Well...  Never mind.

      Sorry 'bout all that.


: Any help would be appreciated


   Don't tilt at windmills.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 16 Jul 1999 00:34:03 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: ok, DBI alt row colors - phrased better w/code
Message-Id: <1dv0dvh.1ihb2qh1y1jsmyN@p113.tc1.metro.ma.tiac.com>

K. Paul Mallasch <pmallasch@mail.starnews.com> wrote:

> What I'd like to do is have <td> change to <td bgcolor="blue"> every other
> time thru the script, resulting in an easier to read table.Is it possible?

How about a toggle?  Something like the following:


print "<table>";

$t = 0;

while (@row = $sth->fetchrow_array) {
  $bgcolor = $t ? ' bgcolor="blue"' : '';
  $t ^= 1;

  print "<tr>";
  print "<td$bgcolor>$row[1]</td>";
  print "<td$bgcolor>$row[2]</td>";
  print "<td$bgcolor>$row[3]</td>";
  print "</tr>\n";
}

print "</table>";


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 16 Jul 1999 00:34:04 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl Programmer Wanted ASAP - Great Rates $$$
Message-Id: <1dv0ea2.1mdgn216r2j8pN@p113.tc1.metro.ma.tiac.com>

The Main Man <webmaster@accessx.com> wrote:

> We are in need for a Perl Programmer to work on a variery of exciting
> new projects in the adult entertainment biz.
                      ^^^^^^^^^^^^^^^^^^^

> Candidate must have own equipment and be ok to work on his/her own and
            ^^^^^^^^^^^^^^^^^^^^^^^              ^^^^^^^^^^^^^^^^^^^
> to strict deadlines.


Well, I have my own equipment, and I often work on my own, if you get
what I mean...


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 15 Jul 1999 06:56:50 -0700
From: chris@loafer.worldhq.org
Subject: Re: Perlscript calling VBScript function
Message-Id: <2bpkm7.8ug.ln@oogabooga.worldhq.org>

kharimi@my-deja.com wrote:
> gurus, geeks and nerds.....please scratch thy brains on this one.......

> how do I make a call to a VBScript funstion/subroutine from Perlscript
> code??
I didn't think gurus, geeks, or nerds used VBscript...hmmm.
-ckm


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

Date: 16 Jul 1999 03:25:16 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: plist parsing
Message-Id: <7mm8ms$hbb$1@lublin.zrz.tu-berlin.de>

Andre van Delft  <delft@delftware.nl> wrote in comp.lang.perl.misc:
># I need a parser for plists, i.e. lists with nested
># dictionaries (hashes) like
>#
>#     ( { text = "aString\n" ;
>#         quote = "\"";
>#         name = file.txt }
>#     , { another = dictionary }
>#     , { text = "last" }
>#     )
>#
># ( ... ) mark lists
># { ... } mark dictionaries
>#
># Below my perl program to parse such plists, but
># I have a few questions.
>#
># QUESTION 1:
># if this is the wheel reinvented, where is the original wheel?

The grammar you have there looks ideally suited for recursive
descent.  There's a module on CPAN named Parse::RecDescent.  I
haven't seen it, but I'd expect it would save you a lot of the
clerical work you had to do here, especially if your structure
is more complex than a linear list of dictionaries.

># QUESTION 2:
># The functions parseList and parseDictionary
># hopefully return proper references to parsed
># lists and dictionaries (with a nested structure).
># Are they 100% OK?

Your code looks fine to me, though I think you speak Perl with a marked
C accent.  But that's okay, TIMTOWTDI.

Apart from that, I have the feeling your references nest one level deeper
than they have to.  You create references to references, which feels
vaguely unnecessary, but I could be wrong.

># QUESTION 3:
># The main program attempts to print the parsed
># data structure assuming it is an list of hashes.
># which is the case for the input given above.
># How would a general set of functions look like
># to print the data structure with arbitrary nestings?

"Arbitrary nesting" can mean a lot of things.  The following bit
of code should work if

  - A list entry can be another (reference to a) list, not just
    a hashref.
  - The value of a hash entry can be another listref or hashref.

A more ambitious attempt would have to keep track of the recursion level
and indent appropriately.  It would also use an occasional line feed.
Your example structure prints (with a line feed added later):

( { name = file.txt text = aString\n quote = \"  }
{ another = dictionaryEntry  }{ text = last  } )

sub print_struct {
  my $struct = shift;
  my $type = ref( $struct);
  if ( $type ) { # It is a reference, go analyze it
      if ( $type eq 'ARRAY' ) {
      print '( ';
      map print_struct( $_), @$struct;
      print ' )';
    } elsif ( $type eq 'HASH' ) {
      print '{ ';
      while ( my( $key, $val ) = each %$struct ) {
        print "$key = ";
        print_struct( $val);
      }
      print ' }';
    } elsif ( $type eq 'REF' ) { # This shouldn't be needed, IMHO
      print_struct( $$struct);
    } else {
      die "error in print_struct: $type\n";
    }
  } else { # It isn't a reference, just print it
    print "$struct ";
  }
}

As you see, it's also a recursive approach, controlled by the type
of reference (HASH or ARRAY) that it found.

[snip original code]

Anno


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

Date: 15 Jul 1999 22:28:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: regexp in substr?
Message-Id: <slrn7ot9lv.c9j.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCXLV September MCMXCIII in
<URL:news:x7d7xtmj21.fsf@home.sysarch.com>:
== >>>>> "A" == Abigail  <abigail@delanet.com> writes:
== 
==   A> A solution that works for non fixed-length matches, and doesn't have the
==   A> overhead of $` and friends:
== 
==   A>      /(RE)/g and $E = pos () - length $1;
== 
== i think you forgot the substr. you assign the offset of RE to $E while
== they store the string starting there.


No, I didn't forget substr(). I just didn't read the article well enough
before replying.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== 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: Thu, 15 Jul 1999 20:18:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: regular expression
Message-Id: <MPG.11f8447025675d26989ce0@nntp.hpl.hp.com>

In article <x7k8s1mk42.fsf@home.sysarch.com> on 15 Jul 1999 21:58:05 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "h" == h0444vcs  <h0444vcs@rz.hu-berlin.de> writes:
>   h> Each line has different fields seperated by ":" (like /etc/passwd ).
> 
>   h> @array = grep { !/$name/  } @array ;
> 
>   h> would remove all entries in the array where $name appears.
>   h> But I want to ensure that only these entries are removed where
>   h> $name appears in a certain field of the line.
> 
> @out = grep { (split ':')[$column] ne $name } @array ;

Because the match might be in the last field, perhaps that should be:

  @out = grep { (split /[:\n]/)[$column] ne $name } @array ;

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


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

Date: Mon, 12 Jul 1999 09:50:52 -0500
From: elaine ashton <elaine@chaos.wustl.edu>
To: simchadov@my-deja.com
Subject: Re: Sending Attachments with email
Message-Id: <Pine.GSO.4.05.9907120946250.23087-100000@chaos.wustl.edu>

[courtesy copy mailed to original author]

> I want to write a Perl script that allows me to build and send an email
> message with an attachment. Are there modules that do this sort of thing
> or has anyone seen examples of ways to do this?

try 'perldoc perlfaq9' or
http://language.perl.com/newdocs/pod/perlfaq9.html#How_do_I_send_mail_

and TPJ has an article in the current issue (#14 with the magic 8-ball) on
page 29 by Dan Sugalski using MIME::Lite and even includes an example
program.

enjoy.

e.



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

Date: Fri, 16 Jul 1999 04:31:40 GMT
From: christianarandaOUT@OUTyahoo.com (Christian M. Aranda)
Subject: set up hash using variables not yet defined
Message-Id: <378eb4af.13948116@news.bmc.com>

I have a hash of hashes which is set up as such:

        %reportSyntax = (
                CPUBUSY         => {
                        genInfo         => "$sysData[$j]{NODE} has
$sysData[$j]{$configData[$i][0]}",
                        unit            => "\%",
                        descText        => "cpu usage",
                        supText         => "for interval
$sysData[$i]{INTERVAL}",
                },
                DISKIO          => {
                        genInfo         =>
"$sysData[$j]{$configData[$i][0]}",
                        unit            => "pages",
                        descText        => "on $sysData[$j]{NODE}",
                        supText         => "with system I/O load of
$sysData[$i]{IODONE}",
                },
        );


The only problem is, when this is set up the counter variables mean
nothing.  When I do the reporting later on, then they actually mean
something.

Is there a way to combat this problem?  One idea I had was to eval
%reportSyntax before I tried to print.  This doesn't seem to work the
way I expect it would.

Any help is appreciated.
----------------------------------------
Christian M. Aranda
Performance Consultant
BMC Software - Waltham, MA


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

Date: Fri, 16 Jul 1999 02:12:04 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Test if a File Exists?
Message-Id: <FExy44.9s2@news.boeing.com>

In article <378dcef8@cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>
>This clearly indicates that the optimal model for documentation listening
>should of course be a fugue.  It's not clear how the pieces would be
>...
>

Hey, the other definition nicely fits the act itself... 

--
Charles DeRykus


Etymology: probably from Italian fuga flight, fugue, from Latin, flight, 
           from fugere
Date: 1597

1a : a musical composition in which one or two themes are repeated or 
     imitated by successively entering voices and contrapuntally developed 
     in a continuous interweaving of the voice parts 
 b : something that resembles a fugue especially in interweaving repetitive 
     elements

2 : a disturbed state of consciousness in which the one affected seems 
    to perform acts in full awareness but upon recovery cannot recollect 
    the deeds


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

Date: Fri, 16 Jul 1999 01:21:01 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: Why we can't do this !?
Message-Id: <378e8191.5777556@news.inet.co.th>

we can do this..!

$x;
first();

sub first{
        local $x = "zen";

        local $x{foo};
        second();
}

sub second{
        print $x;
}

but we can't do this

$x;
first();

sub first{
        local $x = "zen";

        my $x{foo};
        second();
}

sub second{
        print $x;
}

Why!?


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

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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 161
*************************************


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