[15990] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3402 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 17 14:10:28 2000

Date: Sat, 17 Jun 2000 11:10:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961265416-v9-i3402@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 17 Jun 2000     Volume: 9 Number: 3402

Today's topics:
    Re: Mailto accomplished via Perl / CGI ? jhalbrook@my-deja.com
    Re: Mailto accomplished via Perl / CGI ? <dave@dave.org.uk>
    Re: Mailto accomplished via Perl / CGI ? <godzilla@stomp.stomp.tokyo>
    Re: Need help Spliting 1 vaiable in 2 <dave@dave.org.uk>
    Re: Need help Spliting 1 vaiable in 2 (Tad McClellan)
        Newlines again, was Re: Ugh <flavell@mail.cern.ch>
    Re: OT: Re: Taryag Perl <gellyfish@gellyfish.com>
    Re: Perl Install on Win98 <bgregory3@cs.com>
    Re: PerlCRT 2.05 for Win32 <bgregory3@cs.com>
    Re: print pdf <randy@theoryx5.uwinnipeg.ca>
    Re: regexp: replace \t with tab, but not \\t <rootbeer@redcat.com>
    Re: Spot the Syntax Error (Eric Bohlman)
    Re: Taryag Perl <gellyfish@gellyfish.com>
    Re: Ugh (Bart Lateur)
    Re: Variable variable names, was Re: now this is strang <dave@dave.org.uk>
    Re: Variable variable names, was Re: now this is strang (Eric Bohlman)
    Re: Variable variable names, was Re: now this is strang <dave@dave.org.uk>
    Re: Variable variable names, was Re: now this is strang <abe@ztreet.demon.nl>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 17 Jun 2000 14:43:35 GMT
From: jhalbrook@my-deja.com
Subject: Re: Mailto accomplished via Perl / CGI ?
Message-Id: <8ig2ql$f8g$1@nnrp1.deja.com>

In article <20000527001719.15899.00000729@ng-md1.aol.com>,
  caviatte@aol.comNoSpam (Cav) wrote:
> Hi all,
>
> You know the standard mailto tags in an html doc?
>
> (a href=mailto:someone@somewhere.com)someone(/a)
>
> Well, I'm almost dead positive that I've got a few bots harvesting my
pages for
> addresses.  IS THERE A WAY to do something like:
>
> (a href=cgi-bin/email_lookup.cgi?ID=101)someone(/a)
>
> ...and have the script look up the proper email addy AND TRIGGER THE
USER'S
> EMAIL CLIENT TO OPEN as the first example would?
>
> Thanks in advance,
>
>            >>>  Cav  <<<
>
> Cav's Roller Coaster Tycoon Depot
>      http://rct.prohosting.com
>  PLEASE STOP BY FOR A VISIT
>
>

Cav,

You can do this with SSI and Perl. Just have the script lookup
the correct address, then send an html header followed by a print
line ...


Your HTML tag would be:

<!--#exec cgi="/cgi-bin/email_lookup.cgi?ID=101"-->


Your script would be:

#!/usr/bin/perl
 ..
(lookup $addy)
 ..
print "Content-type: text/html\n\n";
print "<a href=mailto:$addy>$addy</a>";
exit;


Best of success...

Joe



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


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

Date: Sat, 17 Jun 2000 16:00:18 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Mailto accomplished via Perl / CGI ?
Message-Id: <6a4nksoihe2cmbmvevc0vfl9fdet0hfi9a@4ax.com>

On Sat, 17 Jun 2000 14:43:35 GMT, jhalbrook@my-deja.com wrote:

>In article <20000527001719.15899.00000729@ng-md1.aol.com>,
>  caviatte@aol.comNoSpam (Cav) wrote:
>> Hi all,
>>
>> You know the standard mailto tags in an html doc?
>>
>> (a href=mailto:someone@somewhere.com)someone(/a)
>>
>> Well, I'm almost dead positive that I've got a few bots harvesting my
>pages for
>> addresses.  IS THERE A WAY to do something like:
>>
>> (a href=cgi-bin/email_lookup.cgi?ID=101)someone(/a)
>>
>> ...and have the script look up the proper email addy AND TRIGGER THE
>USER'S
>> EMAIL CLIENT TO OPEN as the first example would?
>
>Cav,
>
>You can do this with SSI and Perl. Just have the script lookup
>the correct address, then send an html header followed by a print
>line ...
>
>
>Your HTML tag would be:
>
><!--#exec cgi="/cgi-bin/email_lookup.cgi?ID=101"-->
>
>
>Your script would be:
>
>#!/usr/bin/perl
>..
>(lookup $addy)
>..
>print "Content-type: text/html\n\n";
>print "<a href=mailto:$addy>$addy</a>";
>exit;

But that leaves the address in plain view in the HTML that is sent to
the browser (or spider) and therefore gains us nothing.

Even if you change it to 

print qq(<a href="mailto:$addy">$name</a>);

The address is still in the HTML, plainly marked as a 'mailto'
attribute and easy pickings for a spammers spider.

The only safe way to do it woud be to have a form where you can type
the email which only identifies the recipient by an id. The CGI script
that processes this script converts the id to an email address and
sends the email.

But this is getting a bit off topic for clpm, so I'll stop now!

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Sat, 17 Jun 2000 09:47:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Mailto accomplished via Perl / CGI ?
Message-Id: <394BABAD.BE4185BA@stomp.stomp.tokyo>

Dave Cross wrote:
>jhalbrook@my-deja.com wrote:
> >caviatte@aol.comNoSpam (Cav) wrote:

(misc snippage)

> >> You know the standard mailto tags in an html doc?
> >> (a href=mailto:someone@somewhere.com)someone(/a)
> >> Well, I'm almost dead positive that I've got a few bots 
> >> harvesting my pages for addresses.
> >> IS THERE A WAY to do something like:
> >> (a href=cgi-bin/email_lookup.cgi?ID=101)someone(/a)

> >You can do this with SSI and Perl. Just have the script lookup
> >the correct address, then send an html header followed by a print
> >line ...

> >Your HTML tag would be:

> ><!--#exec cgi="/cgi-bin/email_lookup.cgi?ID=101"-->

> >Your script would be:

> But that leaves the address in plain view in the HTML that is sent to
> the browser (or spider) and therefore gains us nothing.

> The address is still in the HTML, plainly marked as a 'mailto'
> attribute and easy pickings for a spammers spider.



Ahem... very clear logical thinking there. 

There are imaginative ways to deal with email harvesting.
One method is to render a bot insane or kill it. Another
method is to provide email addresses of spammers, in place
of your user friendly email list.

Bots which are Perl/CGI based, are easy to drive insane
by reformatting their perl core, leading a bot to harvest
garbage and return gigabytes of mule manure. This a technique,
reformatting perl core, I have demonstrated to someone here,
a number of times, by direct invitation, leading him to constant
axe grinding for a couple of years now. I will leave a reader to
research this independently. These are rather dangerous methods,
for public knowledge; no easy prevention methods are known.

Another choice is to simply kill a bot, which is very easy to
do and equally as dangerous as reformatting perl core. Both
of these are techniques I never discuss publically.

A more gentle method, compared to turning a bot into a beserker
or outright destroying it, is a method of adding known spammers
to an email list to be harvested. Otherwords, send their mule
manure right back to them, in copious juicy quantities. This
only requires doing a whois on _known_ spammers and, printing
an email list with admin / tech / sales email addresses or
whatever _ethical_ addresses you choose to send mule manure.

Identifying a harvesting bot is very easy through use of
user agent variable. You can develop a list or research
our net data bases and develop very complete lists of user
agents exhibited by bots. See User Agents in closing.

Another method of identification is by DNS or IP address.
Easy enough to develop or find a list of offending email
spammers by DNS or IP address. Sample lists are available
by the hundreds via our internet.

My imaginative choice in programming is to not conceal
friendly email lists but rather substitute in an unfriendly
email list of known spammers, of those who making harvesting
bots avaiable, of those who sell commercial bulk mailers
and of those who provide free email accounts known to be
a haven for spammers. My personal choice is to turn a bot
into a beserker which returns megatons of mule manure to
its master or masters. This is rewarding, in notion. If
it is my 28th day, maybe feeling cranky, I may elect to
simply destroy a bot, right then and there, rendering
it useless until repaired.

All of this is easy enough and fun to program. As stated
I won't discuss methods of beserking or destroying bots.
This is way too dangerous for public knowledge and, even
when I demonstrated this for my persistent axe grinder,
this method was encrypted inside garbage data. He never
figured out how I do this, much like many cannot figure
out how Abigail does those stunning signature codes. =)

Array equals known user agents of bots,

if element matches user agent, print fake email list

(...or print beserker / death code)

Same general principle applies to known DNS/IP addys.


Why bother with trying to conceal your friendly email
lists when you can have fun feeding a bot mule manure?
Trying to conceal email addresses is a pointless endeavor.
This very rarely works without a lot of work and annoyance.

Only ethical rule is to be sure you are absolutely right in 
selecting where to send spam mule manure. Being sure means
careful objective research; do your homework wisely. It would
be remiss to send mule manure to innocent people.


Godzilla!



BOT USER AGENT SAMPLES:
_______________________

BizBot04 kirk.overleaf.com
HappyBot
CaliforniaBrownSpider
EI*Net/0.1  libwww/0.1
Ibot/1.0 libwww-perl/0.40    
Merritt/1.0
StatFetcher/1.0
TeacherSoft/1.0  libwww/2.17
WWW Collector
processor/0.0ALPHA libwww-perl/0.20
wobot/1.0
Libertech-Rover
WhoWhere Robot
ITI Spider
w3index
MyCNNSpider
SummyCrawler
OGspider
linklooker
CyberSpyder
SlowBot
heraSpider
Surfbot
Bizbot003
WebWalker
SandBot
EnigmaBot


OFFENDING SPAMMER SAMPLES:
__________________________

205.252.60.71
194.20.32.131
198.5.209.201
acke.dc.luth.se
dallas.mt.cs.cmu.edu
darkwing.cadvision.com
waldec.com
www2000.ogsm.vanderbilt.edu
unet.ca
murph.cais.net
spyder3.microsys.com
www.freeloader.com.


POSSIBLE WHOIS LOOKUP FOR EMAIL ADDYS:
______________________________________

emailemailemail.com
nitro-net.com
bradreaenterprises.com
agis.net
fht.com
hotmail.com
bigfoot.com
dma.org


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

Date: Sat, 17 Jun 2000 15:51:39 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Need help Spliting 1 vaiable in 2
Message-Id: <pa3nksorl4uceheaan0plavag9ia86fn1s@4ax.com>

On Sat, 17 Jun 2000 09:07:14 +0200, Johan Bünger
<phuket@phuket-guide.com> wrote:

>Hi,
>
>I am a new beginner to the perl, I need help with the configuration of a
>script. This is the problem I have:
>
>I am building a web-site named Phuket-guide.com, we would now like to
>have the latest headlines from the local newspaper direct on our first
>page. To do so I was told to get a script called WrapHtml and then
>configure it to work with their .ASP file. 

I'd never heard of this WrapHTML so I've just taken a quick look at it
and it seems that whoever advised you to use it didn't really know
what they were talking about. There's nothing in there that you
couldn't do far easier by using LWP::Simple and CGI.

>Now the problem is that I have no idea about how to do so, I can collect 
>the headlines and links to the headlines. The problem is I can not format 
>it correctly! I get a “piped” version that look like this:
>
>Robbers stab German resident to death|http://www.phuketgazette.com/news/index.asp?id=941
>Teens in ‘Romeo and Juliet’ double suicide|http://www.phuketgazette.com/news/index.asp?id=940
>THAI to launch new Oz-Phuket service|http://www.phuketgazette.com/news/index.asp?id=939
>Sweden pledges help for Cyber City plan|http://www.phuketgazette.com/news/index.asp?id=938
>Angel Air suspends services|http://www.phuketgazette.com/news/index.asp?id=937
>General coy about new job as minister|http://www.phuketgazette.com/news/index.asp?id=936
>Pattana Kathu Party wins landslide victory|http://www.phuketgazette.com/news/index.asp?id=935
>All saved as ferry burns and sinks|http://www.phuketgazette.com/news/index.asp?id=934
>BUPA launches special medical coverage|http://www.phuketgazette.com/news/index.asp?id=933
>
>This is not that fun to place on my firstpage, I would like to have the
>headlines automatically linked to the URL included and just import it to
>my web-site with SSI. I also need the link to open a new window if it is
>clicked on.
>
>I understad that I need to split the values and then get the 2 new
>strings, then use the strings to format the link. I just do not know how
>to split and get them in to the strings. Could any one out their with a
>good hart help me?
>
>This is the Script I use to call the headlines:

Please _always_ use the -w flag and 'use strict' to warn you about
potential problems with your code.

>#!/usr/bin/perl
>require "wraphtml.pl";
>&Init(0);
>&Wrap("Phuketgazette News","white");
>&Font("black","Verdana","-1");
>$content=&CallHTTP("www.phuketgazette.net/feedme/index.asp"); #MUST be connected to internet to do this!
>&Text($content);
>&Wrap();
>
>My thought was to get split $content in to $url, $headlines and then get
>the &Text(<A HREF=”$url”>$headline</A>);
>
>But I don’t know if this works?

Did you try it? that's often the best way to learn stuff in Perl. You
seem to be on the right track tho'.

Assuming that your $content variable contains exactly the text that
you've listed above, you first need to split it into individual lines
doing something like

my @contents = split(/\n/, $content;

You then need to loop round this array, splitting each line in turn
and printing the results...

foreach (@contents) {
  my ($headline, $url) = split /\|/;
  print qq(<a href="http://$url">$headline</a>\n);
}

Notice that I've used Perl's "pick your own quote" operator, qq(), to
avoid having to escape the double quotes within the string.

>I also need the link to open a new window if it is clicked on.

Many people think it's rude for a website to open new windows all the
time, but if you _really_ want to do it change the print line above
to:

print qq(<a href="http://$url" target="_blank">$headline</a>\n);

hth,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Sat, 17 Jun 2000 10:32:18 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Need help Spliting 1 vaiable in 2
Message-Id: <slrn8kn2vi.a7j.tadmc@magna.metronet.com>

On Sat, 17 Jun 2000 09:07:14 +0200, Johan Bünger <phuket@phuket-guide.com> wrote:

>I can collect the headlines and links
>to the headlines. The problem is I can not format it correctly! I get a
>“piped” version that look like this:
>
>Robbers stab German resident to
>death|http://www.phuketgazette.com/news/index.asp?id=941


>My thought was to get split $content in to $url, $headlines and then get
>the &Text(<A HREF=”$url”>$headline</A>);
>
>But I don’t know if this works?


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

my $content = 'Robbers stab German resident to death|http://www.phuketgazette.com/news/index.asp?id=941';

my($headlines, $url) = split /\|/, $content, 2;

print "url '$url'\nheadlines '$headlines'\n";
-------------------------------


>I also need the link to open a new window if it is clicked on.


That is not a Perl question.

Please don't post off-topic questions.


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


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

Date: Sat, 17 Jun 2000 15:23:08 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Newlines again, was Re: Ugh
Message-Id: <Pine.GHP.4.21.0006171502480.21898-100000@hpplus03.cern.ch>

On Sat, 17 Jun 2000, jason wrote:

> Bart Lateur writes ..
> >n.b. The meaning of "\r" and "\n" is platform dependent. On a Mac, "\n"
> >is chr(13) (because that is what the Mac uses), and "\r" is "the other
> >one", i.e. chr(10).

> the meaning is only platform dependant when reading from or writing to a 
> non-binmoded filehandle

Are you disagreeing with what you quoted?  I'd prefer what it says
in perldoc perlport about newline representations.

This has come up quite a few times on the group in the not so distant
past, but I've never seen here on usenet a better explanation than
what appears in the perlport documentation: if anyone thinks they can
do better, then I reckon they should be offering their assistance with
the documentation.

It could be that in your current predicament you're only interested in
unix versus windows, but that's no reason to go contradicting someone
who's talking about the broader principles, Macs etc.

> read from a text filehandle on Windows and all CRLF sequences are 
> converted to LFs .. and the reverse is done on a write

Yes, so far so good.  But the general statement that 'The meaning of
"\r" and "\n" is platform dependent' is a general truth, which
includes Macs, IBM mainframes, VMS etc.

> the 'meaning' inside the Perl code is the same - and platform 
> independent .. 

Only if you're consistent in your notation.

 Perl uses \n to represent the ``logical'' newline, where
 what is logical may depend on the platform in use. In
 MacPerl, \n always means \015. In DOSish perls, \n usually
 means \012, but when accessing a file in ``text'' mode,
 STDIO translates it to (or from) \015\012. 

> the only magic happens when writing to or from a non-
> binmoded filehandle

You're still not addressing the general problem, but only this one
detail in which DOS/Windows differs from unix.

Even then, if someone has transferred a text file cross-platform in
binary mode, and are attempting to use Perl to read the resulting
heap, there's extra work to be done.  The same is true when using
Samba (and PCNFS, as I recall) to share files cross-platform between
DOS/Windows and unix systems. The consistency only extends to using
the standard i/o routines to process files that are in their own
platform's native text format.

See the perlport doc for additional comments about socket programming.

cheers



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

Date: 17 Jun 2000 13:22:12 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: OT: Re: Taryag Perl
Message-Id: <8ifqhk$mb7$1@orpheus.gellyfish.com>

In comp.lang.perl.misc Larry Rosler <lr@hpl.hp.com> wrote:
> 
> The OP, Tzadik (which means Righteous Person => Saint :-)

If I had known I was in the presence of Simon Templar ... So does he
get to drive one of those Volvos :)

> 
> Although 'taryag' is just a number (as evidenced by its sequential 
> nature), the conversion of real words to numbers or vice versa has been 
> the subject of millennia of mystical analysis of sacred texts.
> 
> #!/usr/bin/perl -w
> use strict;
> 
> my %table = (
> #              Heb.  Greek value
>     g => [ qw( gimel gamma    3 ) ],
>     y => [ qw( yodh  iota    10 ) ],
>     r => [ qw( resh  rho    200 ) ],
>     t => [ qw( tav   tau    400 ) ],
> );
> 
> my $sum = 0;
> $sum += $table{$_}[2] for grep $_ ne 'a' => split // => 'taryag';
> print "$sum\n";
> 

Well Larry there doesnt appear to be a Lingua::Hebrew::Numbers module - I
think you know what you've got to do ;-}

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Sat, 17 Jun 2000 18:16:53 +0200
From: "Bob Gregory" <bgregory3@cs.com>
Subject: Re: Perl Install on Win98
Message-Id: <394ba3e7$1@news.piro.net>

Mösl
 this was a good tip.  I forgot about version 612 and downloaded ActivePerl
v522 and Apache Web Server for windows and started learning Perl.  I am
having problems with the installation, because I can write a script, execute
it in a dos window (eg something simple like print a message 10 times), but
I want to have a form written in html which executes a perl program which
takes the fields in the form as input (e.g. ordering a product xyz,and
returns the data formatted (e.g. thank you for ordering xyz).  the perl
program sends the reply to the dos window instead of to the Win IE browser.
I am assuming that when the Apache Web server software is running that it
picks up the output from the Perl programm.
 This is very difficult to debug, but have you got any suggestions how I
could home in on the error?

ps:  I see from your web site that you are from Austria.  I live in Cologne,
Germany, and will be in Wallsee (between Linz and Yibbs on the Donau) end
July!


Mösl Roland <founder@pege.org> wrote in message
news:393a880c$0$20856@SSP1NO17.highway.telekom.at...
> "Bob Gregory" <bgregory3@cs.com> wrote in message
> news:393a7925@news.piro.net...
> > I have tried to install Perl on my PC under Win98 in order to write and
> test
> > Perl scripts & programms.  I downloaded Active Perl 613 für Windows
95/98
> > (InstMsi.exe) from http://www.activestate.com/ActivePerl.  When I
execute
> it
> > nothing happens, i.e. no error messages, but no sign of a correct Perl
> > installation.  Can anyone help me get Perl installed under Win 98?  My
> > target server is Windows NT (private) and Unix (work)
>
> I work with Active Perl 522
>
> I tested 613, but did not work as PerlScript
> on my old Win95 system.
>
> I hope for 614 to fix some small bugs.
>
>
> --
> Mösl Roland http://www.pege.org
> Clear targets for a confused civilization
> http://www.BeingFound.com
> web design and seminars
> +43 699 17343674
>
>
>




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

Date: Sat, 17 Jun 2000 18:24:00 +0200
From: "Bob Gregory" <bgregory3@cs.com>
Subject: Re: PerlCRT 2.05 for Win32
Message-Id: <394ba592@news.piro.net>

Hello Bill
    I recently downloaded ActivePerl v522 from ActiveState.com and Apache
Web Server v 1.3.9 for windows (98) and started learning Perl.  I am having
problems with the installation, because I can write a script, execute it in
a dos window (eg something simple like print a message 10 times), but I want
to have a form written in html which executes a perl program which takes the
fields in the form as input (e.g. ordering a product xyz,and returns the
data formatted (e.g. thank you for ordering xyz).  the perl program sends
the reply to the dos window instead of to the Win IE browser.  I am assuming
that when the Apache Web server software is running that it picks up the
output from the Perl programm.
 This is very difficult to debug, but have you got any suggestions how I
could home in on the error? Is this similar to what you are trying to do?


Bill Hess <billhess2000@home.com> wrote in message
news:TKp25.2022$fR2.28943@news1.rdc1.mi.home.com...
> I am trying to build Perl 5.005_03 with PerlCRT so that sockets work on
> Win98 and WinNT
> I am using a NT (SP6a) box to build Perl with VC++ 5.0
> I am getting the following error - Any suggestions:
>
> Microsoft (R) Program Maintenance Utility   Version 1.62.7022
> Copyright (C) Microsoft Corp 1988-1997. All rights reserved.
>
>         del /f config.h
> Could Not Find D:\hess\util\perl\perl5.005_03\win32\config.h
>         copy config_H.vc config.h
>         1 file(s) copied.
>
>
>
>
>
    cl.exe -c -I. -nologo -Gf -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32
>  -D_CONSOLE -DNO_STRICT   -DPERLDLL -DPERL_CORE   -Od -MD -DNDEBUG  -Foper
lg
> lob.
> obj perlglob.c
> perlglob.c
>         link.exe -nologo -nodefaultlib -release -machine:x86  oldnames.lib
> kerne
> l32.lib user32.lib gdi32.lib  winspool.lib comdlg32.lib advapi32.lib
> shell32.lib
>  ole32.lib  oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib
winmm.lib
> ve
> rsion.lib odbc32.lib odbccp32.lib
> PerlCRT.lib -out:..\perlglob.exe -subsystem:co
> nsole  perlglob.obj setargv.obj
> c:\program files\devstudio\vc\lib\PerlCRT.lib : fatal error LNK1106:
invalid
> fil
> e or disk full: cannot seek to 0x3822fe11
> NMAKE : fatal error U1077: 'link.exe' : return code '0xc'
> Stop.
>
>




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

Date: 17 Jun 2000 15:28:20 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: print pdf
Message-Id: <8ig5ek$dho$1@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc, tbb85@my-deja.com wrote:

> I'm wondering which of the PDF modules listed on CPAN would be the best
> to spend time installing and evaluating.  I need the capability to
> insert GIF or JPG images into my PDF output files.  I looked through
> some of the documentation for PDF::Create, but don't see any reference
> to handling images.

Try http://www.pdflib.com/ - this is a library of pdf functions
that has that capability. There's also a perl binding included.

best regards,
randy kobes


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

Date: Sat, 17 Jun 2000 09:32:29 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: regexp: replace \t with tab, but not \\t
Message-Id: <Pine.GSO.4.10.10006170926391.21108-100000@user2.teleport.com>

On Sat, 17 Jun 2000, Markus Hediger wrote:

>        $POST_DATA{$_} =~ s/\\/\\\\/g;   # keep normal \ as \\
>        $POST_DATA{$_} =~ s/\n/\\n/g;
>        $POST_DATA{$_} =~ s/\t/\\t/g;
> 
> so far so good, but how can i undo that when reading the file? 

You'll have to replace backslash-whatever with the right new char, that's
all.

    s/\\([\\nt])/$real{$1}/g;

I'll let you construct the %real hash yourself. BTW, if you're clever,
you'll now see how to turn your three substitutions above into just one
faster one. Cheers!

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



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

Date: 17 Jun 2000 14:35:47 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Spot the Syntax Error
Message-Id: <8ig2c3$alj$3@slb7.atl.mindspring.net>

Gabe (grichards@flashcom.net) wrote:
: I've been on this one for hours it seems. I'm blind and stupid so please
: help me. And if you've got the time critique my code. I still feel I'm new
: to programming and might not have a firm foothold on some conceptual issues.
: 
: The error message I get says syntax error on line 114 near "elsif". That's
: the last "elsif" in this sub routine I'm posting.

Peter pointed out the immediate cause of your problem, but I see some more.

:  my @fldnames;
:  my %fldsize = ();
: 
:  my $fldnum = $dbh->prepare("SELECT * FROM vehicles");
: $fldnum->execute;
:  my $gettbldef = $dbh->prepare("DESCRIBE vehicles");
: $gettbldef->execute;
:  my $tbldef = $gettbldef->fetchall_arrayref;
: for (my $i=0; $i<$fldnum->{NUM_OF_FIELDS}; $i++) {
:     unless ($tbldef->[$i]->[0] eq 'prosid' || $tbldef->[$i]->[0] eq 'vehid')

Not a problem, but you could make your code more readable by using the 
syntactic sugar Perl provides for LoLs, HoHs, etc.  $tbldef->[$i]->[0] 
can be "abbreviated" as $tbldef->[$i][0].

: {
:         if ($tbldef->[$i]->[2] ne 'YES' && $cgi->param($tbldef->[$i]->[0])
: eq undef)

That's not the way to test whether a value is defined.  That second 
conditional should read "! defined $cgi->param(...)".

: 
:             print

It looks like you lost the opening brace of this block in the process of 
transcription.  It's always a good idea to cut-and-paste code into 
postings rather than retyping it.  If the brace is indeed missing, that 
would cause further errors.

 : 
$cgi->redirect('http://www.bestinsuranceinc.com/incomplete.html');
:             exit;
:        }
:        else {
:            $fldnames[$i] = $tbldef->[$i]->[0];
:            $fldsize{$fldnames[$i]} = $1 if $tbldef->[$i]->[1] =~ /(\d+)/;
:        }
:     }
:  }


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

Date: 17 Jun 2000 13:12:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Taryag Perl
Message-Id: <8ifq03$kh2$1@orpheus.gellyfish.com>

In comp.lang.perl.misc Craig Berry <cberry@cinenet.net> wrote:
> abe kohen (abekohen@cloud9.net) wrote:
> : > What is "Taryag"?
> : 
> : What is "Perl?" (The scripting language?)
> 
> Well, assuming the 'e' is handled by pointing, we get Peh-Resh-Lamed,
> 80+200+30, or 310. :) 
> 

Which was in fact the build number of a certain Activeware Perl based on
5.003 - spooky ;-}

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Sat, 17 Jun 2000 16:26:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Ugh
Message-Id: <394ba5bf.288136@news.skynet.be>

jason wrote:

>>True, but if this was done on a PC, it wouldn't matter. Bare "\r"
>>characters would still be there, and be replaced.
>
>no they're not .. the filehandle is not binmoded - so the lines read in 
>with <> will not contain "\r\n" .. they will contain "\n" as their line 
>endings (once in Perl)

If the contents of a file was "Line one\015Line two\015\012", then,
without binmode, the string read would be "Line one\015Line two\012".
CRLF *pairs* are indeed turned into newlines, but a CR not followed by
LF would remain a CR. Honestly.

>>But the bare linefeeds in the output would still be converted into CRLF
>>pairs, unless you do binmode on the output handle.
>
>you did read that we're going from Windows -> UNIX didn't you ?

Yes, but you didn't say on what platform. Since you complained about not
using binmode when run on a PC, well, I tell you: if you carefully got
rid of all the "\r" characters, and your printed to a file without
binmode, they'd magically reappear in the output.

-- 
	Bart.


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

Date: Sat, 17 Jun 2000 15:22:27 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Variable variable names, was Re: now this is strange...
Message-Id: <6c2nks0kcc1sqin3rolkk3bg551glkel0q@4ax.com>

On Sat, 17 Jun 2000 14:05:32 +0200, "Alan J. Flavell"
<flavell@mail.cern.ch> wrote:

>On Sat, 17 Jun 2000, Kevin M. Sproule wrote:
>
>[a fullquote regularly presages disaster, and this seems no
>exception...]
>
>> foreach $key (keys(%FORM)) {
>>     $$key = $FORM{$key};
>> }
>> 
>> Note the extra $ which means use indirection.  This will assign the values
>> to variables generated by $$key.  Cool stuff!
>
>This seems to me to be an exhibit of the old saying that a little
>knowledge is a dangerous thing.
>
>See specifically http://www.plover.com/~mjd/perl/varvarname2.html
>
>and the other two articles in the series.
>
>Perl stalwarts: why can't I find this topic in the Perl FAQs? Is it
>not there, or am I failing to find it?  Maybe I'm over-sensitive, but
>it seems to me that it comes up with sufficient regularity to justify
>a mention.

There's a section about it called 'Sybmbolic References' in perlref.

hth,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: 17 Jun 2000 14:41:16 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Variable variable names, was Re: now this is strange...
Message-Id: <8ig2mc$alj$4@slb7.atl.mindspring.net>

Dave Cross (dave@dave.org.uk) wrote:
: On Sat, 17 Jun 2000 14:05:32 +0200, "Alan J. Flavell"
: <flavell@mail.cern.ch> wrote:
: >Perl stalwarts: why can't I find this topic in the Perl FAQs? Is it
: >not there, or am I failing to find it?  Maybe I'm over-sensitive, but
: >it seems to me that it comes up with sufficient regularity to justify
: >a mention.
: 
: There's a section about it called 'Sybmbolic References' in perlref.

Which, unfortunately, isn't part of the FAQs.  I can only imagine that 
this topic simply wasn't a FAQ at the time the FAQs were written; it does 
seem to be coming up more and more often.



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

Date: Sat, 17 Jun 2000 15:54:06 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Variable variable names, was Re: now this is strange...
Message-Id: <764nks44p8fsf5otftf4libqc01tvunfl8@4ax.com>

On 17 Jun 2000 14:41:16 GMT, ebohlman@netcom.com (Eric Bohlman) wrote:

>Dave Cross (dave@dave.org.uk) wrote:
>: On Sat, 17 Jun 2000 14:05:32 +0200, "Alan J. Flavell"
>: <flavell@mail.cern.ch> wrote:
>: >Perl stalwarts: why can't I find this topic in the Perl FAQs? Is it
>: >not there, or am I failing to find it?  Maybe I'm over-sensitive, but
>: >it seems to me that it comes up with sufficient regularity to justify
>: >a mention.
>: 
>: There's a section about it called 'Sybmbolic References' in perlref.
>
>Which, unfortunately, isn't part of the FAQs.  I can only imagine that 
>this topic simply wasn't a FAQ at the time the FAQs were written; it does 
>seem to be coming up more and more often.

That's true. I was _sure _ that I'd seen it in the FAQs, but a
thorough search erlier this afternoon failed to find it so it seems
that Alan was right.

Perhaps we should raise a bug against the FAQ and get it added.

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Sat, 17 Jun 2000 19:38:58 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Variable variable names, was Re: now this is strange...
Message-Id: <nlcnksk9v4hi6perfns6s8g2j4kjo1crm6@4ax.com>

On Sat, 17 Jun 2000 15:54:06 +0100, Dave Cross <dave@dave.org.uk> wrote:

> On 17 Jun 2000 14:41:16 GMT, ebohlman@netcom.com (Eric Bohlman) wrote:
> 
> >Dave Cross (dave@dave.org.uk) wrote:
> >: On Sat, 17 Jun 2000 14:05:32 +0200, "Alan J. Flavell"
> >: <flavell@mail.cern.ch> wrote:
> >: >Perl stalwarts: why can't I find this topic in the Perl FAQs? Is it
> >: >not there, or am I failing to find it?  Maybe I'm over-sensitive, but
> >: >it seems to me that it comes up with sufficient regularity to justify
> >: >a mention.
> >: 
> >: There's a section about it called 'Sybmbolic References' in perlref.
> >
> >Which, unfortunately, isn't part of the FAQs.  I can only imagine that 
> >this topic simply wasn't a FAQ at the time the FAQs were written; it does 
> >seem to be coming up more and more often.
> 
> That's true. I was _sure _ that I'd seen it in the FAQs, but a
> thorough search erlier this afternoon failed to find it so it seems
> that Alan was right.
> 
> Perhaps we should raise a bug against the FAQ and get it added.

Did you try (something like):

	D:\>grep -ni "symbolic" d:/usr/lib/Pod/perlfaq*.pod

There is a question in perlfaq7:
	"How can I use a variable as a variable name?"

-- 
Good luck,
Abe


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

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

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


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


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