[7955] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1580 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 5 00:07:43 1998

Date: Sun, 4 Jan 98 21:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 4 Jan 1998     Volume: 8 Number: 1580

Today's topics:
     **1A Please Help, Perl is harrassing me ** <dmartine@cu.campus.mci.net>
     Re: `Free Live Saucy Chat! (brian d foy)
     Re: FULL TIME EMPLOYMENT (brian d foy)
     HELP ME How I can to compare two date 01/12/1997>=01/01 <jcc@sodefesa.es>
     Help please... <eka16@hotmail.com>
     Re: Help please... <rootbeer@teleport.com>
     Re: Help please... <*@qz.to>
     Re: Help please... <ajohnson@gpu.srv.ualberta.ca>
     Re: How to check files exists and if it does then? (brian d foy)
     Re: htmlcolorizer4U <jeffrey@halcyon.com>
     Re: i am a newbie (Fabrice Scemama)
     i need perl5.0** <webmaster@www.synergy.co.kr>
     Need Help - Perl on Win95/NT, problem with debugging <james.chiou@isocor.com>
     Re: Perl editor needed (Michael Kelly)
     Re: perl is c worsened (was: Re: word wrap routine) (brian d foy)
     Re: Perl Trick? (Fabrice Scemama)
     Re: Perl Trick? (William Byrd)
     Perlshop and sub error_trap (N.A.F. McNelly)
     Problems with << operator and cgi- michael@anchor.demon.co.uk
     Re: Problems with << operator and cgi- <rootbeer@teleport.com>
     Re: sending email (Net::SMTP).. problem <gbarr@pobox.com>
     Re: sending email (Net::SMTP).. problem <*@qz.to>
     Server Push Problem. <mhanson@arrowweb.com>
     Re: Server Push Problem. <rootbeer@teleport.com>
     The Roth.Net server <larrywj@larrywj.seanet.com>
     Use modem as voice speed dialer? (doug a blaisdell)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 04 Jan 1998 20:37:19 -0700
From: David Martinez <dmartine@cu.campus.mci.net>
Subject: **1A Please Help, Perl is harrassing me **
Message-Id: <34B0556F.CA9B7CCE@cu.campus.mci.net>

I have a form that takes information and an email address is one of
them.  I then write this information to another file.

Perl thinks that the @ symbol is the beginning of an array obviously.
Can anyone show me some code that would search the $form{'email'}
variable for the @ symbol and then stick the \ (backslash) symbol in
front of it so it takes it as a literal?

Would this be an 'if' statement kind of thing?



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

Date: Sun, 04 Jan 1998 17:21:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: `Free Live Saucy Chat!
Message-Id: <comdog-ya02408000R0401981721400001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34aea4a0.0@london.netkonect.net>, Ian<ianc@atlantic-brands.com> posted:

>I thought readers might like to know of a great site I've found.
>It is free and fun.

cool!  Perl does all of that?

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Sun, 04 Jan 1998 17:19:24 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: FULL TIME EMPLOYMENT
Message-Id: <comdog-ya02408000R0401981719240001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34AD72E5.349E@alex.net>, marcus@alex.net posted:

>The Alexander Group, Inc. is seeking qualified PERL programmers for full
>and part-time employment along with contract work.  We are a custom
>Internet Applications company that has been around for nearly five
>years.  We are located in Indianapolis, Indiana USA.

i asked last time, but i'll ask again (and keep asking until you get
it).  what is "qualified".  just because someone knows perl, or
any other language, does not mean that the person has the skills or
experience to do you job.

so what is "qualified"?  databases experience?  networking experience?
can form complete sentences?  has a temperature above the ambient 
temperature?

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Mon, 5 Jan 1998 01:43:48 +0100
From: "Jose Carrasco Clemente" <jcc@sodefesa.es>
Subject: HELP ME How I can to compare two date 01/12/1997>=01/01/1997
Message-Id: <68p9r8$q4i$1@talia.mad.ibernet.es>

Help me i can not to compare two date.

jcc@sodefesa.es

Thanks




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

Date: Sun, 04 Jan 1998 07:02:32 -0600
From: Eka <eka16@hotmail.com>
Subject: Help please...
Message-Id: <34AF8868.1B9FD021@hotmail.com>

Hi...

I have couple newbie questions for you :)

1. @stuff = ('This', 'is', 'a', 'list.');
   splice(@stuff, 3, 0, ('fine', 'little'));
                    ^^^
   what does integer 0 mean?

2. $#ARGV, @ARGV, $ARGV
   what the difference between them? can someone explain their
functions?
   I'm using Perl 5 for Win32

3. Let say, I declare a variable :
   $my = 'Land and Bird';
   and i try to replace string 'and' to '&', but what i got is
   "L& & Bird"
   (the result is supposed to be 'Land & Bird')
   Can anyone tell a solution is?


Thanks for the help, i really appriciate it.



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

Date: Sun, 4 Jan 1998 16:43:26 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Eka <eka16@hotmail.com>
Subject: Re: Help please...
Message-Id: <Pine.GSO.3.96.980104163756.4298B-100000@user2.teleport.com>

On Sun, 4 Jan 1998, Eka wrote:

> Subject: Help please...

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

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

> 1. @stuff = ('This', 'is', 'a', 'list.');
>    splice(@stuff, 3, 0, ('fine', 'little'));
>                     ^^^
>    what does integer 0 mean?

The number between +1 and -1. :-)  But maybe you want to check the entry
for splice in the perlfunc manpage. 

> 2. $#ARGV, @ARGV, $ARGV
>    what the difference between them? can someone explain their
> functions?

Those should be documented in the perlvar manpage. Note that $#ARGV is
using the @ARGV variable.

> 3. Let say, I declare a variable :
>    $my = 'Land and Bird';
>    and i try to replace string 'and' to '&', but what i got is
>    "L& & Bird"
>    (the result is supposed to be 'Land & Bird')
>    Can anyone tell a solution is?

You probably want the \b (word boundary) zero-width regular expression
assertion, which is documented in the perlre manpage.

If you have more Perl questions which aren't answered in the docs, please
post them here. (But it's generally better to post unrelated questions in
separate messages, since that allows someone to easily answer only some of
them.) Thanks!

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



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

Date: 5 Jan 1998 01:22:57 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Help please...
Message-Id: <qz$9801041947@qz.little-neck.ny.us>

Eka  <eka16@hotmail.com> wrote:
> I have couple newbie questions for you :)

Heh heh. I've got a couple of things for your reading list.
It would probably be best to start with:

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

To learn about picking a good subject line.

> 1. @stuff = ('This', 'is', 'a', 'list.');
>    splice(@stuff, 3, 0, ('fine', 'little'));
>                     ^^^
>    what does integer 0 mean?

Next you should read the perlfunc manpage that should have come with
perl.

> 2. $#ARGV, @ARGV, $ARGV
>    what the difference between them? can someone explain their
> functions?

This one should be in perldata (with a smattering of perlvar perhaps).

>    I'm using Perl 5 for Win32

You might need to use the perldoc program rather than man to get
at the accompanying documentation then.

> 3. Let say, I declare a variable :
>    $my = 'Land and Bird';
>    and i try to replace string 'and' to '&', but what i got is
>    "L& & Bird"
>    (the result is supposed to be 'Land & Bird')
>    Can anyone tell a solution is?

This is perl, so there is more than one way. Here's an interesting one:

	$my = 'Land and Bird';
	{ my $ym = pack "u", $my;
	  $ym =~ tr:-:+:;
	  $ym =~ s'!A;F0@0FER9``'`F($)I<F0';
	  $my =unpack "u",$ym;
	}

> Thanks for the help, i really appriciate it.

Your questions read a lot like homework problems, you know.

Elijah
------
has been known to give graders a hard time with absurdly complex answers


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

Date: Sun, 04 Jan 1998 13:55:07 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Help please...
Message-Id: <34AFE91B.1125E68B@gpu.srv.ualberta.ca>

Eka wrote:
!
! Hi...
! 
! I have couple newbie questions for you :)
! 
! 1. @stuff = ('This', 'is', 'a', 'list.');
!    splice(@stuff, 3, 0, ('fine', 'little'));
!                     ^^^
!    what does integer 0 mean?

see the description of splice() in the included documentation:
try 'perldoc -f splice' and if everything is installed correctly
you should get the doc for splice...

splice ARRAY,OFFSET,LENGTH,LIST
                    ^^^^^^
essentially, splice replaces elements of an array starting at
position OFFSET for LENGTH elements with the LIST ... in the
above case, we are doing an insert as the LENGTH is zero. The
array grows or shrinks as necessary.

 
! 2. $#ARGV, @ARGV, $ARGV
!    what the difference between them? can someone explain their
! functions?
!    I'm using Perl 5 for Win32
see the perlvar manpage, or try 'perldoc perlvar'

$#ARGV ... number of command line arguments minus one
@ARGV  ... the array of command line arguments
$ARGV[0] ... the first command line argument
$ARGV  ... current filename when reading from <>
ARGV   ... special filehandle iterating over commandline filenames
 
! 3. Let say, I declare a variable :
!    $my = 'Land and Bird';
!    and i try to replace string 'and' to '&', but what i got is
!    "L& & Bird"
!    (the result is supposed to be 'Land & Bird')
!    Can anyone tell a solution is?

see the perlre manpage, 'perldoc perlre'
one way for this particular case:

$string = 'Land and Bird';
$string =~ s/\band\b/&/;
print $string;

but maybe, $string =~ s/ and /&/; would be more appropriate
in this case.

there is a win32 version of the "Learning Perl" book from
O'Reilly...called "Learning Perl for Win32" or something like
that--- haven't read that one, but I've found O'Reilly books
to *always* be worth the investment.

hope it helps
regards
andrew


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

Date: Sun, 04 Jan 1998 17:31:19 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to check files exists and if it does then?
Message-Id: <comdog-ya02408000R0401981731190001@news.panix.com>
Keywords: from just another new york perl hacker

In article <9thyrcA2Obr0EwEZ@worsdall.demon.co.uk>, Mark Worsdall <shadowweb@worsdall.demon.co.uk> posted:

>In article <waabtxznw1t.fsf@ese.UCSC.EDU>, "William R. Ward"
><hermit@cats.ucsc.edu> writes

>Can you expand/explain each digit/dubberry in:-
>>s/^([^\.]+)\.(.*)\.txt$/$2-$1.txt/;

let's rewrite it using the eXtended notation:

   s/
      ^         #anchor at start of string
      (         #begin capture into $1
         [^\.]    #match anything that's not in the set \ and .
           +        #one or more times (does that \ belong there?)
      )         #end capture into $1   

      \.        #match a literal .

      (         #begin capture into $2         
         .        #match anything,
         *          #as much as possible, but possibly nothing
      )         #end capture into $2    

      \.        #match a literal .

      txt       #match the literal txt

      $         #anchor at end of string
   /$2-$1.txt/x;

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 4 Jan 1998 23:52:03 GMT
From: Thanh Luu <jeffrey@halcyon.com>
Subject: Re: htmlcolorizer4U
Message-Id: <68p7b3$1u1$1@brokaw.wa.com>

In article <comdog-ya02408000R0201980125160001@news.panix.com>
brian d foy, comdog@computerdog.com writes:
>thanks.  what is it?
>
The structure for an html colorizer.
1 - Save expression_to_match, [html_head_tag, html_tail_tag]
      into %my_hash
2 - build an s/// command with all expressions to match ORed
together
3 -eval() it
4 - colorize sub branches on
s/(each)|(ORed)|(term)|(found)|(here)//
5 - and attaches the corresponding tags

I do'nt think there is a special variable containing the
number of the term that matched.
But you can use &or_term_number to avoid the big bunch of ifs:
sub or_term_number {
   #find the true one $1 ... $n
   local $i = 0; $special_k = 0; #start false
   until (eval($special_k)) {
     $i++;
     $special_k = '$' . $i;
   }
   return $i;
}


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

Date: Mon, 05 Jan 1998 04:51:00 GMT
From: fabrice.scemama@gesnet.net (Fabrice Scemama)
Subject: Re: i am a newbie
Message-Id: <34afc017.4221670@news.hol.fr>

On Thu, 01 Jan 1998 22:45:42 -0800, ~arthur <star@sonic.net> wrote:

>Hi,
>
>Could anyone explain how to make an html doc (a page on www) work with a
>simple program i made with perl:
> 
>#!/usr/bin/perl -w
>print "Hi!,what is your name?";
>$name = <stdin>;
>chomp $name;
>if ($name eq "lisa"){
>print  "hello lisa i love you\n";
>} else {
>print "hello, $name!\n";
>}
>
>Thanks 4 the help,
>~arthur
>star@sonic.net


You should set up a HTML form, then make
your PERL script output another HTML doc.

Your present script can only work within
your local compiler (assuming you replace the
if ($name eq "lisa")
line with
if ($name == "lisa").


/Fabrice Scemama



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

Date: Mon, 5 Jan 1998 10:16:11 +0900
From: "jea kwnag lee" <webmaster@www.synergy.co.kr>
Subject: i need perl5.0**
Message-Id: <68pcel$frd$1@news.nuri.net>

hi there
i need windowNT perl5.0**





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

Date: Sun, 4 Jan 1998 18:46:39 -0800
From: "James Chiou" <james.chiou@isocor.com>
Subject: Need Help - Perl on Win95/NT, problem with debugging
Message-Id: <68phi0$qca@news1.zippo.com>

This is a multi-part message in MIME format.

------=_NextPart_000_000D_01BD1941.177BCD40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Deal All,

I am new to Perl and am using Perl (5.004) native port for Win32. =
Everything seems to be running fine, except when I time type 'R' to =
restart my debugging session. The following message was displayed:

Can't locate Term/ReadLine.pm in @INC (@INC contains:) at =
C:\LOCAL\PERL\lib/perl5db.pl line 1356.
Unrecoverable error at C:\LOCAL\PERL\lib/perl5db.pl line 1859.

Can't locate Term/ReadLine.pm in @INC (@INC contains:) at =
C:\LOCAL\PERL\lib/perl5db.pl line 1356.
END failed--cleanup aborted.

Unrecoverable error at C:\LOCAL\PERL\lib/perl5db.pl line 1859.

Any idea why this happened? I checked the value of "@INC" (by printing =
it out from the other script) and it seems to be fine. I even tried to =
include Term::ReadLine as it does from perl5db.pl and the script runs =
just fine.

I thank you for your help in advance.

James Chiou
-----------------------
ISOCOR
Tel: +1 (310) 581-8100
Fax: +1 (310) 581-8111
http://www.isocor.com


------=_NextPart_000_000D_01BD1941.177BCD40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Deal All,</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>I am new to Perl and am =
using Perl=20
(5.004) native port for Win32. Everything seems to be running fine, =
except when=20
I time type 'R' to restart my debugging session. The following message =
was=20
displayed:</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Can't locate =
Term/ReadLine.pm in @INC=20
(@INC contains:) at C:\LOCAL\PERL\lib/perl5db.pl line 1356.</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Unrecoverable error at=20
C:\LOCAL\PERL\lib/perl5db.pl line 1859.</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2><BR>Can't locate =
Term/ReadLine.pm in=20
@INC (@INC contains:) at C:\LOCAL\PERL\lib/perl5db.pl line 1356.<BR>END=20
failed--cleanup aborted.</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Unrecoverable error at=20
C:\LOCAL\PERL\lib/perl5db.pl line 1859.</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Any idea why this =
happened? I checked=20
the value of &quot;@INC&quot; (by printing it out from the other script) =
and it=20
seems to be fine. I even tried to include Term::ReadLine as it does from =

perl5db.pl and the script runs just fine.</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I thank you for your help in =
advance.</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2><BR>James=20
Chiou<BR>-----------------------<BR>ISOCOR<BR>Tel: +1 (310) =
581-8100<BR>Fax: +1=20
(310) 581-8111<BR><A=20
href=3D"http://www.isocor.com">http://www.isocor.com</A><BR></FONT>&nbsp;=
</DIV></BODY></HTML>

------=_NextPart_000_000D_01BD1941.177BCD40--



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

Date: Mon, 05 Jan 1998 01:58:46 GMT
From: mkelly99@NOSPAMgate.net (Michael Kelly)
Subject: Re: Perl editor needed
Message-Id: <34bd3dc6.6600252@news.gate.net>

On 31 Dec 1997 15:11:35 GMT, jhurd@indiana.edu (James Hurd) wrote:

>	When I first began writing Perl and Java, I resisted
> learning Emacs.When I finally broke-down andd beganb toi learn it; 
> it made things so much easier.

Anyone know if there's an enhancement for xcoral Perl Mode?
I've found xcoral feels a lot like emacs under X but is a lot smaller.
The only trouble is the default Perl Mode doesn't seem to do much.

I've searched around the web and Perl-ring and haven't come up with anything.

TIA



Mike

"Genius gives birth, talent delivers."

                - Jack Kerouac

(remove NOSPAM from address, if present, to reply)


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

Date: Sun, 04 Jan 1998 17:20:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl is c worsened (was: Re: word wrap routine)
Message-Id: <comdog-ya02408000R0401981720160001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34AF31C9.3921729D@5sigma.com>, joseph@5sigma.com posted:

>Oh, come on, that delimiter thing is getting old now.  :-)

can you teach new dogs old tricks though?

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Mon, 05 Jan 1998 04:51:03 GMT
From: fabrice.scemama@gesnet.net (Fabrice Scemama)
Subject: Re: Perl Trick?
Message-Id: <34afc0a3.4361939@news.hol.fr>

On Fri, 02 Jan 1998 02:12:28 -0500, Eddie Brown
<eddie@NOSPAMMING.cs.odu.edu> wrote:

>Besides having a java program execute a perl prog: does anyone know
>of a way of having a perl program execute as soon as a page is accessed?
>
>Any help is much appreciated.
>
>Thanks,
>Eddie
>

What about linking your CGI script directly ?...
Or using a <META...> linking to the CGI.
Or using a SSI (<!--#EXEC  CGI="/cgi/aaa.cgi"-->).


/Fabrice Scemama



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

Date: Mon, 05 Jan 1998 06:30:10 GMT
From: wcb4@erols.com (William Byrd)
Subject: Re: Perl Trick?
Message-Id: <68poon$22c$1@winter.news.erols.com>

On Sun, 4 Jan 1998 04:37:06 -0600, "Sam Iron" <persoft@cris.com>
wrote:

>Reading between the lines, my guess is that you should be looking into
>server side INCLUDES in your (s)html code.
>
>>Besides having a java program execute a perl prog: does anyone know
>>of a way of having a perl program execute as soon as a page is accessed?
>
>
>


I know is is possible to specify a perl script as the source for a
graphic (Matt Wright's non-parsed header gif animation script) could
this be used to call a perl script. To avoid returnign a broken
graphic link though you would have to return a Content:x-image/gif and
a redirection a real gif file though. I could be compeltely wrong on
this, but it seems tomake sense, perhaps one more knowledgable than I
cold fill in some details, and check out the folks on
comp.infosystems.whatever it is that deals with CGI's (check the FAQ
since everyone on this newsgroup seems to keep passing CGI related
questions off there anyway)

wcb4@erols.com



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

Date: Sun, 04 Jan 1998 21:48:19 -0500
From: nmcnelly@bu.edu (N.A.F. McNelly)
Subject: Perlshop and sub error_trap
Message-Id: <nmcnelly-0401982148190001@ppp-96-13.bu.edu>

I've been installing Perlshop, and all goes well until I reach
the "submit order" stage after entering credit card info, etc.
At this point (whether I use the non-secure or secure server),
I routinely get the message:

"Undefined subroutine &main::error_trap called at" [directory]

While &error_trap certainly turns up a number of times, I've looked for
the matching  sub error_trap in Perlshop and there isn't one. I've 
re-downloaded the latest version just to be sure, and can't find one 
there either.  

And yet I know others who run the script without having problems with 
this undefined subroutine.

What am I doing wrong?
 ................................................................
Nancy McNelly                 
http://www.halfmoon.org/
Rabbit in the Moon: Mayan Hieroglyphics and Architecture


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

Date: Sun, 04 Jan 1998 16:32:40 -0600
From: michael@anchor.demon.co.uk
Subject: Problems with << operator and cgi-
Message-Id: <883951879.1371340801@dejanews.com>

I seem to be having problems in using the << string definer under
perl v 5.  For example, the following function within the cgi-lib.pl
library doesn't load - but when I use a normal text string, it works OK.
There's also a similar problem in ReadParse, which uses another << string
definer (in a more complex manner), and I haven't found a work-around.

sub HtmlTop
{
  local ($title) = @_;
  return <<END_OF_TEXT;
  <html>
  <head>
  <title>$title</title>
  </head>
  <body>
  <h1>$title</h1>
  END_OF_TEXT
}


I've also had problems with similar types of syntax in mail-lib - e.g. the
following fails to load.

 print MAIL <<__END_OF_MAIL__;
 To: $touser
 From: $fromuser
 Subject: $subject
 $messagebody
 __END_OF_MAIL__


Can anyone shed any light on this?  If possible, I'd like to avoid
changing everything to CGI.pm, but will obviously do that if it's the
only way.

Many thanks.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Sun, 4 Jan 1998 15:04:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: michael@anchor.demon.co.uk
Subject: Re: Problems with << operator and cgi-
Message-Id: <Pine.GSO.3.96.980104150317.24944Z-100000@user2.teleport.com>

On Sun, 4 Jan 1998 michael@anchor.demon.co.uk wrote:

> sub HtmlTop
> {
>   local ($title) = @_;
>   return <<END_OF_TEXT;
>   <html>
>   <head>
>   <title>$title</title>
>   </head>
>   <body>
>   <h1>$title</h1>
>   END_OF_TEXT
> }

The termination line of a here-document should contain nothing but that
string and its trailing newline. Make sure that there aren't any spaces,
tabs, return characters, or anything else before or after the tag. Hope
this helps!

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



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

Date: Sun, 04 Jan 1998 17:37:57 -0600
From: Graham Barr <gbarr@pobox.com>
To: catty <spam@spam.spam>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <34B01D55.AB2A3C68@pobox.com>

catty wrote:
> I prefer to aim for the recipient's server if possible,
> bypassing the relay hop unless the target is unavailable.
> Something like this fragment:

Then I hope you don't always expect your mail to be read. I
myself automatically trash any mail that cannot be traced as
this is a common technique used by spammers. I know of several
other people who do this to. There are also some ISP's that will
refuse to deliver mail that cannot be traced.

I would highly recommend that you connect to your local
SMTP host.

Graham.


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

Date: 5 Jan 1998 01:42:19 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <qz$9801042033@qz.little-neck.ny.us>

Graham Barr  <gbarr@pobox.com> wrote:
> catty wrote:
> > I prefer to aim for the recipient's server if possible,
> > bypassing the relay hop unless the target is unavailable.
> > Something like this fragment:
> 
> Then I hope you don't always expect your mail to be read. I
> myself automatically trash any mail that cannot be traced as
> this is a common technique used by spammers. I know of several

What are you going on about? How do you define "traced"?  It is
a perfectly legitimate thing to connect to an SMTP server and
give it mail. It is up to the receiving SMTP server to add a
"Received" header that states where the mail came from.

> other people who do this to. There are also some ISP's that will
> refuse to deliver mail that cannot be traced.

I still have no idea what you are thinking "trace" is.

> I would highly recommend that you connect to your local
> SMTP host.

I don't need to relay mail to have it get delivered, why do you think
discarding non-relayed mail will reduce your spam?

Elijah
------
followups redirected to a more topical group



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

Date: Sun, 04 Jan 1998 18:09:46 -0800
From: Mike <mhanson@arrowweb.com>
Subject: Server Push Problem.
Message-Id: <34B040EA.6735@arrowweb.com>

What is wrong with the following. I want it to send mail and then when
its sending it send the progress to the browser. But for some reason it
doesn't work. Thanks for your help! 8-)

print "$ENV{'SERVER_PROTOCOL'} 200 OK\n";
print "Server: $ENV{'SERVER_SOFTWARE'}\n";
print "Content-type:
multipart/x-mixed-replace;boundary=processdone\n\n";
print "Content-type: text/html\n\n";
print <<"html";
<HTML>
<HEAD>
<TITLE>Sending Mail</TITLE>
</HEAD>
<BODY bgcolor=ffffff>
<form method=post action=$admincgi>
<table bgcolor="99cccc" border=1>
<tr><th>Sending Mail</th></tr></table><br><br>
<table bgcolor="99cccc" border=1>
html
print "\n--processdone\n";
$|=1;
$countall = "0";
$countmail = "0";
$files = ""; 
chdir($ads_dir);
$ls = `ls $files`;
@ls = split(/\s+/,$ls);
$totalsent = ($#ls + 1);
foreach $displayad (@ls) {
$displayad =~ s/.txt//g;
&openread;
$countall += 1;
if ($mail eq "yes") {
$countmail += 1;
   # Open The Mail Program
   open(MAIL,"|$mailprog -t");
   print MAIL "To: $email\n";
   print MAIL "From: $youremail\n";
   print MAIL "Subject: $INPUT{'meaning'}\n";
   print MAIL "$INPUT{'info'}\n\n";
close (MAIL);
sleep 2; }
$percdone = int ($countall / $totalsent);
print "Content-type: text/html\n\n";
print "<tr><th bgcolor=efefef>$countmail Messages Sent So
Far!</th></tr>";
print "<tr><th bgcolor=efefef>$percdone\% Complete!</th></tr>";
print "\n--processdone\n";
&flush(STDOUT);
} 
exit; }


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

Date: Sun, 4 Jan 1998 16:49:34 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike <mhanson@arrowweb.com>
Subject: Re: Server Push Problem.
Message-Id: <Pine.GSO.3.96.980104164412.4298C-100000@user2.teleport.com>

On Sun, 4 Jan 1998, Mike wrote:

> What is wrong with the following.

It's not properly indented to make it easy to read and maintain, and the
curly braces don't properly match up. The command 'perl -wc yourprog' will
help you check for the latter error.

> I want it to send mail and then when its sending it send the progress
> to the browser. But for some reason it doesn't work.

Of course, when you fix the problems which I pointed out, it may still not
do what you want. If the problem is that you're having trouble with the
Server Push protocol, you should check the specs to ensure that you've
implemented that properly, or ask in a newsgroup about servers or the
protocol if you're still not sure. If you still have Perl problems,
though, (say, syntax errors you don't understand, or when you know what to
print but you can't get Perl to print it) you could try posting here
again. Good luck!

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



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

Date: Sun, 4 Jan 1998 17:40:32 -0800
From: "Larry Janow" <larrywj@larrywj.seanet.com>
Subject: The Roth.Net server
Message-Id: <68pdre$rjm@q.seanet.com>

Howdy folks.  Just so you know, the Roth.net server is down due to two
things:  1) my lame ISP and 2) Roth Consulting has relocated to Seattle.
The server will be down until a new ISP can be found that can handle the
traffic and services.
Dave will be without email until the the server is brought back online,
hopefully in the next few weeks.





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

Date: Sun, 4 Jan 1998 23:11:40 GMT
From: dougb@world.std.com (doug a blaisdell)
Subject: Use modem as voice speed dialer?
Message-Id: <EMA8FG.54F@world.std.com>

Hi Everybuddy!
I'd like to use my modem to do my voice telephone dialing for me.
I know there's a win95 utility for this, but I wanted to do it on
Linux, preferably using Perl. I've gotten to the point where I can
do the dialup OK, but I don't know how to tell the modem to give
control to the telephone, after somebody answers the phone.

Anybuddy know how to do this?

thanks,
doug




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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

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

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


------------------------------
End of Perl-Users Digest V8 Issue 1580
**************************************

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