[29689] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 933 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 13 03:09:42 2007

Date: Sat, 13 Oct 2007 00:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 13 Oct 2007     Volume: 11 Number: 933

Today's topics:
    Re: a nice little perl utility and a minimal nntp clien <zaxfuuq@invalid.net>
    Re: a nice little perl utility and a minimal nntp clien <anonymous@127.0.0.1>
    Re: a nice little perl utility and a minimal nntp clien <tadmc@seesig.invalid>
    Re: a nice little perl utility and a minimal nntp clien <zaxfuuq@invalid.net>
    Re: a nice little perl utility <thepoet_nospam@arcor.de>
    Re: Cantankerous trolliness ad infinitum, was: Re: The   bbound@gmail.com
        DBI Mysql insert problem <yshtil@cisco.com>
    Re: DBI Mysql insert problem <mritty@gmail.com>
    Re: DBI Mysql insert problem <paduille.4061.mumia.w+nospam@earthlink.net>
    Re: LWP, Post, return data ? <wheeledBob@yahoo.com>
    Re: quotes difference in Perl5.6 vs 5.8 <stoupa@practisoft.cz>
    Re: quotes difference in Perl5.6 vs 5.8 <stoupa@practisoft.cz>
    Re: The Modernization of Emacs: terminology buffer and   bbound@gmail.com
    Re: Windows,ASSOC,FTYPE,.pl,.plx,.sh <veatchla@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Oct 2007 16:13:57 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: a nice little perl utility and a minimal nntp client
Message-Id: <sbSdne9oHfEDbJLanZ2dnUVZ_rKtnZ2d@comcast.com>

Can you elaborate?  If you'd be inclined to e-mail instaed, I'm
wade@zaxfuuq.net .



> (1) Create a shortcut to the cmd.exe prompt.
> (2) Set the Target: to, C:\WINDOWS\system32\cmd.exe /K CD /D
> (3) It doesn't matter what you put in the Start in: box.
> (4) Move the shortcut to the %userprofile%\sendto\.
> (5) Right click inside any Explorer window on a folder, then
>    click upon SendTo..., then upon the newly created shortcut.
>
> It will ALWAYS open in the folder that you tell it to open in.
> If you want a default folder in case you don't click upon such,
> then fill in the Start in: textbox.
>
> The /D is a switch for the CHDIR command. It tells it to log on
> to the drive first, in case you want to open a prompt on another
> drive.
>
> Hope this helps.
I finally got the kinks worked out on this:
##  minimal nntp client
##  by Wade Ward
##  Contributors: Michele Dondi, Gunnar Hjalmarsson

#!/usr/bin/perl -1

use strict;
use warnings;
use Net::NNTP;
use Date::Parse;

my $nsrv='newsgroups.comcast.net';
my $grp='comp.lang.perl.misc';
my $USER = '';
my $PASS = '';

my $nntp=Net::NNTP->new($nsrv) or die "Can't login to `$nsrv'$!\n";
$nntp->authinfo($USER,$PASS) or die $!;
my (undef, $first, $last, undef)=$nntp->group($grp)
    or die "Can't access $grp\n";

my ($since, @arts)=time-10*60*60;
  for (reverse $first..$last) {
      my %hdr=map /^(\S[^:]+):\s(.*)$/g, @{$nntp->head($_)};
      defined(my $date=$hdr{'NNTP-Posting-Date'}) or next;
      defined(my $time=str2time $date)
        or warn "Couldn't parse date for article $_ ($date)\n"
        and next;
      last if $time < $since;
      unshift @arts, $_;
  }

  $nntp->article($_,\*STDOUT) for @arts;

  __END__

Abridged output follows sig.
-- 
wade ward


#abridged output:
Path:
border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!i13g2000prf.googlegroups.com!not-for-mail
From:  "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Newsgroups: comp.lang.perl.misc
Subject: Re: LWP, Post, return data ?
Date: Fri, 12 Oct 2007 06:08:11 -0700
Organization: http://groups.google.com
Lines: 42
Message-ID: <1192194491.195360.190670@i13g2000prf.googlegroups.com>
References: <uhmtg3lhf8pr0e6ucl5aut8bfjo338o26l@4ax.com>
   <1192156707.725636.162380@e34g2000pro.googlegroups.com>
   <r1stg319qfh33o8nre87elhqordmp89ho2@4ax.com>
NNTP-Posting-Host: 130.76.32.181
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1192194491 24799 127.0.0.1 (12 Oct 2007 13:08:11
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 12 Oct 2007 13:08:11 +0000 (UTC)
In-Reply-To: <r1stg319qfh33o8nre87elhqordmp89ho2@4ax.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12)
Gecko/20050915 Firefox/1.0.7 (CCK-Boeing),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: i13g2000prf.googlegroups.com; posting-host=130.76.32.181;
   posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0
Bytes: 2559
Xref: number1.nntp.dca.giganews.com comp.lang.perl.misc:639030

On Oct 11, 9:00 pm, still me <wheeled...@yahoo.com> wrote:
> On Thu, 11 Oct 2007 19:38:27 -0700, Paul Lalli <mri...@gmail.com>
> wrote:
>
> ...

> >LWP::UserAgent::post() returns an HTTP::Response object.
>
> >http://search.cpan.org/~gaas/libwww-perl-5.808/lib/HTTP/Response.pm
>
> >    $response = $ua->request($request)
> >    if ($response->is_success) {
> >        print $response->content;
> >    }
> >    else {
> >        print STDERR $response->status_line, "\n";
> >    }
>
> >Paul Lalli
>
> I need a little more help. I also need to access the return headers
> that are sent back from the called cgi. I read this:
>
> http://search.cpan.org/~gaas/libwww-perl-5.808/lib/HTTP/Headers.pm
>
> And I think I need to access this: $h->as_string( $eol )
>
> But I am having trouble making the logical jump as to how the code
> would actually look. It's clear enough when I want to create a new
> header object, but how do I get the return values from the "$response
> = $ua->request($request)" to populate the header object? Some detailed
> code would be very helpful.
>

print $response->headers_as_string;

*  or, to pull a specific header:
    eg,   print $response->header("Client-Peer")

--
Charles DeRykus


 ...

<jon_johnfrancisayres@yahoo.com> wrote in message
news:1192199023.034893.245880@z24g2000prh.googlegroups.com...
> Introducing The Dhourties And The Dualdigers, Nudism? Nakedity?
> Aren't
> We Born Naked? Isn't Our Naked Skin Our Clothes? Is Being Born Naked
> A
> Crime By The Dhourties' Logic If Nudity In Public Is A Crime?

> You do not need under arm deodorant as it is filled with toxic
> animals
> that will destroy your body and eat up your organs animals. Use
> peanut
> oil for your underarms, and for your groin, and for your feet, and
> for
> your butt hole, and butt crack, if you are worried about unpleasant
> odors. You can also use any other nicely scented oil with flowers
> oils
> mixed in it, as I've mentioned, previously, how to press flowers for
> making perfume oils.


Maybe, but Max is still a bastard.

AC

 ...


> I'm ASTONISHED!! Why on hell do you need to do that?!?
>
> >http://www.zaxfuuq.net/perl6.htm
>
> You're assuming wrong that for all users the DOS windows will open in
> that directory as you can set it to what you like. I, for one, set it
> to C:\temp.
>
> Incidentally you don't need 4 different cd's where one would suffice:
>
>   cd \perl\bin
>
> this is also better in that it will not depend on the starting
> directory to be "C:\Documents and Settings\Merl".
>
> But then again, why do you need it at all? Since you like screenshots
> I'll show you one portraying a minimal session out of a freshly opened
> DOS prompt:
>
> http://blazar.perlmonk.org/tmp/merl01.png
>
> (Sorry for not wrapping a html page with my .sig around it, I suppose
> you can survive.)
>
> Note: for those that unlike our friend do *not* like screenshots, it's
> simply as follows
>
>   Microsoft Windows XP [Versione 5.1.2600]
>   (C) Copyright 1985-2001 Microsoft Corp.
>
>   C:\temp>wjed merl.pl
>
>   C:\temp>cat merl.pl
>   #!/usr/bin/perl -l
>
>   use strict;
>   use warnings;
>
>   my $adj=shift || 'freak';
>   print "Merl iz a $adj!";
>
>   __END__
>
>   C:\temp>merl crank
>   Merl iz a crank!
>
>   C:\temp>merl
>   Merl iz a freak!
>
>   C:\temp>
>
> Michele
> --
> {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
> (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
> 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,

I solved this a long time ago on XP by just downloading the XP power
toy that lets you right click on a folder and open command window
there and being sure perl is in the path. But there are some handy
perl utilities that I have written and used perl2exe on. Simple ones
like fixnames.exe that will take all the filenames in the current
directory and make them lowercase, remove spaces, extra puncuation
things like that. Another that takes a simple text file that I create
in the current directory called from.txt and creates an HTML form with
javascript checking to be sure all required input is included.

Bill H




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

Date: Fri, 12 Oct 2007 19:45:49 -0400
From: "Jim Carlock" <anonymous@127.0.0.1>
Subject: Re: a nice little perl utility and a minimal nntp client
Message-Id: <47100732$0$24281$4c368faf@roadrunner.com>

"Wade Ward" wrote...
: Can you elaborate?  If you'd be inclined to e-mail instaed, I'm
: wade@zaxfuuq.net .

> I solved this a long time ago on XP by just downloading the XP
> power toy that lets you right click on a folder and open command
> window there and being sure perl is in the path.

What I posted is just an alternative way to open a cmd prompt in
an appropriate folder. It's quicker to use the CD command. But
sometimes if you're browsing things using Explorer and you want to
open a cmd prompt in a particular folder you see, you can right-
click upon the folder, click upon SendTo, and send the folder to
the cmd prompt shortcut in the SendTo folder. It doesn't really
send anything, except it does deliver this command line to the
cmd prompt:

C:\WINDOWS\system32\cmd.exe /K CD /D <folder_name>

Where the cmd prompt then opens, the /K switch tells it to stay
open instead of closing, the CD /D command tells it to log onto
the appropriate drive, and change to the identified folder. It's
quite handy at times.

-- 
Jim Carlock
Swimming Pool, Spa And Water Feature Builders
http://www.aquaticcreationsnc.com/



> (1) Create a shortcut to the cmd.exe prompt.
> (2) Set the Target: to, C:\WINDOWS\system32\cmd.exe /K CD /D
> (3) It doesn't matter what you put in the Start in: box.
> (4) Move the shortcut to the %userprofile%\sendto\.
> (5) Right click inside any Explorer window on a folder, then
>    click upon SendTo..., then upon the newly created shortcut.
>
> It will ALWAYS open in the folder that you tell it to open in.
> If you want a default folder in case you don't click upon such,
> then fill in the Start in: textbox.
>
> The /D is a switch for the CHDIR command. It tells it to log on
> to the drive first, in case you want to open a prompt on another
> drive.




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

Date: Fri, 12 Oct 2007 19:08:14 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: a nice little perl utility and a minimal nntp client
Message-Id: <slrnfh033e.nia.tadmc@tadmc30.sbcglobal.net>


> Abridged output follows sig.


Please do not put abridged output following sig.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 12 Oct 2007 19:09:42 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: a nice little perl utility and a minimal nntp client
Message-Id: <H4CdnUfEtvpSh43anZ2dnUVZ_hadnZ2d@comcast.com>



"Jim Carlock" <anonymous@127.0.0.1> wrote in message 
news:47100732$0$24281$4c368faf@roadrunner.com...

> C:\WINDOWS\system32\cmd.exe /K CD /D <folder_name>
>
> Where the cmd prompt then opens, the /K switch tells it to stay
> open instead of closing, the CD /D command tells it to log onto
> the appropriate drive, and change to the identified folder. It's
> quite handy at times.

>> (1) Create a shortcut to the cmd.exe prompt.
>> (2) Set the Target: to, C:\WINDOWS\system32\cmd.exe /K CD /D
>> (3) It doesn't matter what you put in the Start in: box.
>> (4) Move the shortcut to the %userprofile%\sendto\.
>> (5) Right click inside any Explorer window on a folder, then
>>    click upon SendTo..., then upon the newly created shortcut.
>>
>> It will ALWAYS open in the folder that you tell it to open in.
>> If you want a default folder in case you don't click upon such,
>> then fill in the Start in: textbox.
>>
>> The /D is a switch for the CHDIR command. It tells it to log on
>> to the drive first, in case you want to open a prompt on another
>> drive.
I didn't do everything you have above, but what you had was enough for me to 
muddle my way through.  I right-clicked on my desktop, selected
new => shortcut
, pasted in the following:
 C:\WINDOWS\system32\cmd.exe /K CD /D \perl\bin
, named it, and
voila, activating the shortcut creates a dos window that has perl.exe in its 
directory.  This is definitely in keeping with the perl virtue of laziness.

Thanks for your attention.
-- 
wade ward
"Nicht verzagen, Bruder Grinde fragen." 




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

Date: Sat, 13 Oct 2007 08:52:18 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: a nice little perl utility
Message-Id: <47106ae7$0$7685$9b4e6d93@newsspool2.arcor-online.net>

h3xx wrote:
> On Oct 12, 12:39 pm, Michele Dondi <bik.m...@tiscalinet.it> wrote:
>>
>>   Microsoft Windows XP [Versione 5.1.2600]
>>   (C) Copyright 1985-2001 Microsoft Corp.
>>
>>   C:\temp>wjed merl.pl
>>
>>   C:\temp>cat merl.pl
>>   #!/usr/bin/perl -l
>>
>>   use strict;
>>   use warnings;
>>
>>   my $adj=shift || 'freak';
>>   print "Merl iz a $adj!";
>>
>>   __END__
 >
> This last line is unnecessary. You'll hardly EVER see it unless
> there's a data section below it, which I haven't seen but once.

This last line is a de facto standard in Perl related newsgroups.
Many newsreaders have (or can be added) the functionality to
recognize and extract/run Perl scripts based on the shebang line,
so the __END__ marker can be used to determine the end of the
embedded code.

-Chris


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

Date: Fri, 12 Oct 2007 23:37:43 -0000
From:  bbound@gmail.com
Subject: Re: Cantankerous trolliness ad infinitum, was: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <1192232263.239129.154870@v29g2000prd.googlegroups.com>

On Oct 10, 4:11 am, Matthias Buelow <m...@incubus.de> wrote:
>
> Is this some sport of yours to constantly create new gmail accounts and
> spam Usenet?

I am not a spammer. You, however, *are* a liar.

[snip remaining insults]
[correct newsgroups: header after attempted hijacking to make my
response disappear]



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

Date: Fri, 12 Oct 2007 15:18:13 -0700
From: Yuri Shtil <yshtil@cisco.com>
Subject: DBI Mysql insert problem
Message-Id: <1192227441.314717@sj-nntpcache-3.cisco.com>

The start field in an MYsql table is defined as follows:
start TIMESTAMP

I am using DBi::Mysql and am trying to update a column as follows:

  $sth = $dbh->prepare_cached('update tests set start=? where db_id=?');
  $sth->execute('NULL', 1);

The last statement returns 1 (one row updated), but I cannot see it it the database.

What I noticed also, the server connection goes away after a number of like updates issued, however the server logs show nothing about update statements.
Something fishy is going on on the client side.

Using $dbh->do('update tests set start=NULL where db_id=1') works,
doing the same from a command line works as well.

I am using perl v5.8.8 built for i686-linux, DBI version 1.58,  DBD::mysql version 4.005, MySQL Version: MySQL 5.0.45-community-log.

Any clues ?


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

Date: Fri, 12 Oct 2007 16:40:58 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: DBI Mysql insert problem
Message-Id: <1192232458.500794.47050@v23g2000prn.googlegroups.com>

On Oct 12, 6:18 pm, Yuri Shtil <ysh...@cisco.com> wrote:
> The start field in an MYsql table is defined as follows:
> start TIMESTAMP
>
> I am using DBi::Mysql

There is no such module.  Did you perhaps mean DBI and DBD::mysql?

> and am trying to update a column as follows:
>
>   $sth = $dbh->prepare_cached('update tests set start=? where db_id=?');
>   $sth->execute('NULL', 1);

That says to update the tests table and set start equal to the four-
character string 'NULL', not to the special database value NULL.

> The last statement returns 1 (one row updated),

No.  execute() does not return the number of rows updated.  Have you
read the documentation for the module you're using?

perldoc DBI
     "execute"
           $rv = $sth->execute                or die $sth->errstr;
           $rv = $sth->execute(@bind_values)  or die $sth->errstr;

         Perform whatever processing is necessary to execute the
         prepared statement.  An "undef" is returned if an error
         occurs.  A successful "execute" always returns true
         regardless of the number of rows affected, even if it's
         zero (see below). It is always important to check the
         return status of "execute" (and most other DBI methods)
         for errors if you're not using "RaiseError".
[...]
     "rows"
           $rv = $sth->rows;

         Returns the number of rows affected by the last row
         affecting command, or -1 if the number of rows is not
         known or not available.


> but I cannot see it it the database.
>
> What I noticed also, the server connection goes away after a
> number of like updates issued, however the server logs show
> nothing about update statements.
> Something fishy is going on on the client side.

"Something fishy" is going on in your code.

> Using $dbh->do('update tests set start=NULL where db_id=1') works,

Of course it does.  But would you expect
UPDATE tests SET start='NULL' WHERE db_id = 1;
to work as well?

> Any clues ?

Read the documentation for the modules you're using.  Again from
perldoc DBI:
     NULL Values

     Undefined values, or "undef", are used to indicate NULL
     values.  You can insert and update columns with a NULL value
     as you would a non-NULL value.  These examples insert and
     update the column "age" with a NULL value:

       $sth = $dbh->prepare(qq{
         INSERT INTO people (fullname, age) VALUES (?, ?)
       });
       $sth->execute("Joe Bloggs", undef);

       $sth = $dbh->prepare(qq{
         UPDATE people SET age = ? WHERE fullname = ?
       });
       $sth->execute(undef, "Joe Bloggs");


Paul Lalli



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

Date: Fri, 12 Oct 2007 18:52:53 -0500
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: DBI Mysql insert problem
Message-Id: <13h027llf2al053@corp.supernews.com>

On 10/12/2007 05:18 PM, Yuri Shtil wrote:
> The start field in an MYsql table is defined as follows:
> start TIMESTAMP
> 
> I am using DBi::Mysql and am trying to update a column as follows:
> 
>  $sth = $dbh->prepare_cached('update tests set start=? where db_id=?');
>  $sth->execute('NULL', 1);
> 
> The last statement returns 1 (one row updated), but I cannot see it it 
> the database.
> [...]

(Comp.lang.perl.modules was cut from the newsgroups: header.)

A similar problem was discussed last month, but before we proceed we 
need a *minimal but complete* script from you that demonstrates the problem.

Hint: Make sure you explicitly disconnect the DBI connection.




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

Date: Sat, 13 Oct 2007 01:04:24 GMT
From: still me <wheeledBob@yahoo.com>
Subject: Re: LWP, Post, return data ?
Message-Id: <6760h3l06shq1galr8o0oadq0v7ecvja81@4ax.com>

On Fri, 12 Oct 2007 05:22:27 -0700, Paul Lalli <mritty@gmail.com>
wrote:


>Again, from that same URL as above:
>
>"HTTP::Response is a subclass of HTTP::Message and therefore inherits
>its methods."
>
>Therefore, we now look at: http://search.cpan.org/~gaas/libwww-perl-5.808/lib/HTTP/Message.pm
>
>which shows us some available methods, such as:
>$mess->headers
>    Returns the embedded HTTP::Headers object.
>
>$mess->headers_as_string
>$mess->headers_as_string( $eol )
>    Call the as_string() method for the headers in the message.
>    This will be the same as
>
>    $mess->headers->as_string
>
>    but it will make your program a whole character shorter :-)
>
>
>Paul Lalli


Thanks Paul. I was getting a bit confused amongst all the objects. 


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

Date: Sat, 13 Oct 2007 07:11:15 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: quotes difference in Perl5.6 vs 5.8
Message-Id: <fepkgv$2jha$1@ns.felk.cvut.cz>

Paul Lalli wrote:
> On Oct 11, 8:48 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
>> I have script written in Perl 5.6.1 and it wotk fine. But when I run
>> the same script on hosting server then this fail on trivial
>> operation. On server Perl 5.8.0 is installed.
>> The example to ilustrate error is this
>>
>> #!/usr/bin/perl
>> use strict;
>> use warnings;
>> my $var = "abcd'efg";
>> open OUT, "> log.txt";
>
> You're not checking the return value of open.  You have no idea
> whether or not this file was actually opened.
>
> open OUT, '>', 'log.txt' or die "Could not open log: $!";

I already do it in the same ways as you and OUT is opened and some is 
written in it ;-) This was be a example only.

>
>> print OUT "$var\n"; # here script fail on server with SIG-PIPE signal
>
Real erorr is this:

------CUT--------
SIG-PIPE  at /home/leon/priceminer/priceminer.pl line 34
main::__ANON__('PIPE') called at /home/leon/priceminer/priceminer.pl line 
1781
eval {...} called at /home/leon/priceminer/priceminer.pl line 1781
main::loging(0, '        IP: SVC-COR-NS5X J-Care Core Support for NS5X 
(all') called at /home/leon/priceminer/priceminer.pl line 1087
------CUT--------

I know that string I want to write to OUT pipe is
    "        IP: SVC-COR-NS5X J-Care Core Support for NS5X (all')"
I store it to variable $var this way
    $var = "        IP: SVC-COR-NS5X J-Care Core Support for NS5X (all')";
and now I call function
    loging(0,$var);

sub loging {
my ($something_not_important, $message) = @_;
print OUT "$message\n";
}

By me the problem is in apostrophe near the string end. On Perl 5.6.1 this 
work without problems, but on 5.8.0 this fail. I tried to change print to 
pipe to
    print OUT $message, "\n";
and now this work on both Perl versions.
Something must be wrong in Perl 5.8.0 I think ;-)

-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)




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

Date: Sat, 13 Oct 2007 07:16:55 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: quotes difference in Perl5.6 vs 5.8
Message-Id: <fepkgv$2jha$2@ns.felk.cvut.cz>

Abigail wrote:
>                                            _
> Petr Vileta (stoupa@practisoft.cz) wrote on VCLV September MCMXCIII in
> <URL:news:femg9b$10oj$1@ns.felk.cvut.cz>:
> ))  I have script written in Perl 5.6.1 and it wotk fine. But when I
> run the ))  same script on hosting server then this fail on trivial
> operation. On server ))  Perl 5.8.0 is installed.
> ))  The example to ilustrate error is this
> ))
> ))  #!/usr/bin/perl
> ))  use strict;
> ))  use warnings;
> ))  my $var = "abcd'efg";
> ))  open OUT, "> log.txt";
> ))  print OUT "$var\n"; # here script fail on server with SIG-PIPE
> signal ))  close OUT;
> ))
> ))  Is something wrong in my script or is some bug in Perl 5.8.0 ?
>
>
> There's something wrong with your script. You're not checking the
> return value of 'open', blindly assuming it succeeds.
>
I checking it, of course. This was be example only. When my script fail then 
tens or hudreds of lines are written in.
I thing that some difference is between Perl 5.6.1 and 5.8.0 in work with 
quoutes.

#!/usr/bin/perl
use strict;
use warnings;
my $var = "abcd'efg";
open OUT, "> log.txt" or die("You stupid!");
print OUT "$var\n";
close OUT;

This work in Perl 5.6.1 but fail in 5.8.0, but if I change this
    print OUT "$var\n";
to this
    print OUT $var, "\n";
then this work in both Perl versions.
-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)




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

Date: Fri, 12 Oct 2007 23:39:37 -0000
From:  bbound@gmail.com
Subject: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <1192232377.453463.155140@i38g2000prf.googlegroups.com>

On Oct 11, 5:40 pm, "John W. Kennedy" <jwke...@attglobal.net> wrote:
> nebulou...@gmail.com wrote:
> > Do not bluntly contradict me in public.
>
> [insult deleted]
>
> [death threat deleted]

Insults and other such falsehoods will be deleted rather than repeated
and death threats will be reported to your internet service provider;
this is a public service provided by me for free.

Have a nice day. :)



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

Date: Fri, 12 Oct 2007 21:04:41 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: Windows,ASSOC,FTYPE,.pl,.plx,.sh
Message-Id: <13h09td5bmtr484@news.supernews.com>

Jim Carlock wrote:
> In setting up Perl within a Windows OS, what's the best way to
> configure Perl so that a Perl file can get run inside a cmd.exe
> prompt, but without using ASSOC or FTYPE to configure things.
> 
> Once ASSOC and FTYPE are run, they configure HKLM inside the
> registry which in turn makes the whole operating system realize
> Perl is installed, and makes the operating system vulnerable to
> various exploits.
> 
> I hope to run a Perl application/script only inside a specific
> cmd.exe prompt, preferably one set up with a .cmd or .bat file,
> that in turn does not anyone viewing a website to run Perl. In
> other words, I seek to not allow the whole operating system to end
> up with the global updates that commands, ASSOC and FTYPE, employ.
> 
> Does anyone know of a way to prevent ASSOC and FTYPE from making
> a change to the registry? Or perhaps of another way other than
> having to type in "Perl.exe printenv.pl"?
> 

So you want to install Perl on a windows server but do not want Perl 
scripts to execute via the web.  Correct?

What web server are you using?  Would your security concerns be 
addressed if you disassociate Perl within the web server configuration? 
  I know with IIS 6, Perl is not automatically enabled when you install 
Perl, you must do extra configuration to enable Perl.

-- 

Len


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

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


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 933
**************************************


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