comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Perl bug for use strict - be forewarned!!         


Author: Tintin
Date: Jan 28, 2008 22:18

Hi Folks,

I am hoping I am wrong here but is this a bug with reference to the
code segment below?

================================================
#!/usr/local/bin/perl
use strict;
use warnings;

$a=10;

print $a++ . "\n";
print $a . "\n";

================================================
After compilation and execution ==>
10
11
================================================
Perl version information is as below:
perl -v

This is perl, v5.8.8 built for darwin-thread-multi-2level
(with 10 registered patches, see perl -V for more detail)
Show full article (1.99Kb)
4 Comments
  FAQ 8.42 How do I make a system() exit on control-C?         


Author: PerlFAQ Server
Date: Jan 28, 2008 18:03

This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

8.42: How do I make a system() exit on control-C?

You can't. You need to imitate the system() call (see perlipc for sample
code) and then have a signal handler for the INT signal that passes the
signal on to the subprocess. Or you can check for it:

$rc = system($cmd);
if ($rc & 127) { die "signal death" }

--------------------------------------------------------------------
Show full article (1.32Kb)
no comments
  Re: Version 5.8.8.8 html docs are shifted over (hidden) about 4 or 5 pixels to the left off the frame. WTF?         


Author: Thrill5
Date: Jan 28, 2008 16:44

netherlands.co> wrote in message
news:t77lp3l5muv7t6e4ra1p5msn1o8edn623v@4ax.com...
> Does anybody els have this problem? Its so anoying I wan't to go back to
> 5.8.6.
>
>
Probably an issue in the style sheet. Don't have 5.8.8 so I don't know what
to fix....
no comments
  Re: regular expression negate a word (not character)         


Author: Paul McGuire
Date: Jan 28, 2008 13:37

On Jan 25, 7:16 pm, Summercool gmail.com> wrote:
> somebody who is a regular expression guru... how do you negate a word
> and grep for all words that is
>
>   tire
>
> but not
>
>   snow tire
>
> or
>
>   snowtire
>

Too bad pyparsing's not an option. Here's what it would look like:
Show full article (0.98Kb)
no comments
  FAQ 9.20 How do I send mail?         


Author: PerlFAQ Server
Date: Jan 28, 2008 12:03

This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

9.20: How do I send mail?

Use the "sendmail" program directly:

open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
or die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: User Originating Mail
To: Final Destination
Subject: A relevant subject line

Body of the message goes here after the blank line
in as many lines as you like.
EOF
close(SENDMAIL) or warn "sendmail didn't close nicely";
Show full article (2.77Kb)
no comments
  Re: regular expression negate a word (not character)         


Author: Greg Bacon
Date: Jan 28, 2008 10:53

The code below at least passes your tests.

Hope it helps,
Greg

#! /usr/bin/perl

use warnings;
use strict;

use constant {
MATCH => 1,
NO_MATCH => 0,
};
Show full article (1.36Kb)
3 Comments
  line wrapping         


Author: monkeys paw
Date: Jan 28, 2008 10:34

I have entries typed in by clients that need to wrap.
If a client were to type in a string of chars (say 100) without a space,
i need a substitution that would insert a break and newline at space
80. How would one do that with a s/// type statement?
2 Comments
  FAQ 9.1 What is the correct form of response from a CGI script?         


Author: PerlFAQ Server
Date: Jan 28, 2008 06:03

This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

9.1: What is the correct form of response from a CGI script?

(Alan Flavell a5.ph.gla.ac.uk> answers...)

The Common Gateway Interface (CGI) specifies a software interface
between a program ("CGI script") and a web server (HTTPD). It is not
specific to Perl, and has its own FAQs and tutorials, and usenet group,
comp.infosystems.www.authoring.cgi

The CGI specification is outlined in an informational RFC:
http://www.ietf.org/rfc/rfc3875

Other relevant documentation listed in:
http://www.perl.org/CGI_MetaFAQ.html

These Perl FAQs very selectively cover some CGI issues. However, Perl
programmers are strongly advised to use the CGI.pm module, to take care
of the details for them.
Show full article (2.88Kb)
no comments
  CRLF problem.         


Author: John
Date: Jan 28, 2008 03:19

I create a small perl file on a Windows platform and all the lines will end
CRLF. I upload the file to server A and it runs OK. I upload the same file
to server B and I get the 500 error message. If I chande all the CRLF to
LF the program works OK on server B.
Both servers are on Linux platforms. How can I automatically convert CRLF
to LF on server B. Or, what is server A doing that server B is not.

Regards
John
5 Comments
  FAQ 9.17 How do I check a valid mail address?         


Author: PerlFAQ Server
Date: Jan 28, 2008 00:03

This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

9.17: How do I check a valid mail address?

(partly contributed by Aaron Sherman)

This isn't as simple a question as it sounds. There are two parts:

a) How do I verify that an email address is correctly formatted?

b) How do I verify that an email address targets a valid recipient?

Without sending mail to the address and seeing whether there's a human
on the other end to answer you, you cannot fully answer part *b*, but
either the "Email::Valid" or the "RFC::RFC822::Address" module will do
both part *a* and part *b* as far as you can in real-time.
Show full article (3.73Kb)
no comments