On 2010-12-26 18:28, Brian Fraser wrote:
> Your example actually works -- On perl 5.13.+:
> http://www.effectiveperlprogramming.com/blog/683
that's good news (even though it means I'll have to wait
a little longer until I can actually use it) - at least I'm
obviously not the only one who felt, tha
Is it possible to get a value from a given-when statement?
Suppose I have a long comparison in which all branches affect
the same variable. Here's a short example (minor variation
from"perlsyn"):
given($something) {
when (/^abc/) { $x = 1; }
when (/^def/) { $x = 2; }
when (/^xyz/) { $
On 2010-05-13 19:00, Patrick Dupre wrote:
> How can I execute the following command in a Makefile ?
>
> CORE_INC=`perl -MConfig -MFile::Spec::Functions -le 'print
> catfile($Config{archlib},"CORE")')`
>
> The problem is with the $Config !
CORE_INC=`perl -MConfig -MFile::Spec::Functions -le 'prin
Because I had little need for it I had tried to just ignore Perl's
Unicode support as long as possible. Now it looks like I can't do that
anymore, so I started looking through the various docs.
One thing that confused me: several sources mention Perl using 8-bit
characters as long as possible, whi
Chas. Owens wrote:
On Sat, Aug 29, 2009 at 11:44, Peter Daum wrote:
I'm struggling with a tricky quoting problem:
I need to split lines divided by some delimiter;
- The delimiter usually will be '|',
but can be changed, so it needs to be variable.
- Furthermore, the columns m
I'm struggling with a tricky quoting problem:
I need to split lines divided by some delimiter;
- The delimiter usually will be '|',
but can be changed, so it needs to be variable.
- Furthermore, the columns may also contain the delimiter,
in which case it is quoted by a backslash
No problem
John W. Krahn wrote:
Peter Daum wrote:
Unfortunately, this leads right to the next problem:
I also need "binmode" to turn off cr/lf conversion on DOS;
with "while (<>)" I don't know where to do this anymore,
because AFAIK, this has to be done after open, but bef
Shawn H. Corey wrote:
Peter Daum wrote:
Unfortunately, this leads right to the next problem:
I also need "binmode" to turn off cr/lf conversion on DOS;
with "while (<>)" I don't know where to do this anymore,
because AFAIK, this has to be done after open, but
Ed Avis wrote:
Peter Daum yahoo.de> writes:
With more recent Perl versions, when
a script is called with '*.xyz' it will just try to open '*.xyz' and
fail.
What version of Perl do you have? (perl -V)
... when I 1st encountered this problem, it was with ActivePe
Shawn H. Corey wrote:
I've always used:
beg...@argv=glob(@ARGV)}
... I still need at least:
BEGIN{ @ARGV=map { glob($_) } @ARGV }
but that's already much shorter - thanks :-)
Unfortunately, this leads right to the next problem:
I also need "binmode" to turn off cr/lf conversion on DOS;
wit
Hi,
I occasionally have to write Perl scripts that should behave the same on
Unix- and DOS-like Systems. One little problem I encounter there is:
For quick hacks, the "while(<>)" mechanism is very handy, because it
saves a lot of typing. On Unix, I can call a script as a filter, with
filenames o
t
variations I could think of (buffer sizes, autoflush, syswrite instead of print,
delays ...) but so far I couldn't find anything that makes a difference.
Does anybody have an idea? Any hints are welcome!
Regards,
Peter Daum
--
To unsubscribe, e-mail: beginners-unsubscr..
se lots of confusion ...)
With "Net::SNMP", it works to retrieve the value in question,
but it has some other issues, so I am trying to get "SNMP" to
work ...
Peter
Rob Dixon wrote:
Peter Daum wrote:
I am trying to retrieve a bit vector containing th
Hi,
I am trying to retrieve a bit vector containing the error status of
a printer with the Net-SNMP module.
With the command line snmpget program, this works:
# snmpget -v1 -cpublic printer .1.3.6.1.2.1.25.3.5.1.2.1
HOST-RESOURCES-MIB::hrPrinterDetectedErrorState.1 = Hex-STRING: 00
With the Ne
Peter Daum wrote:
I recently upgraded a system (as far as perl is concerned from 5.8.8 to
5.10.0). Afterwards I ran into a mysterious problem. I could eventually
> find a workaround, but still don't really understand, what is going on.
After the upgrade, a perl program wouldn'
Peter Daum wrote:
- Where does glib come into play? Is it generally used by perl?
Oops - I just noticed that it doesn't say "glib" but "glibc"
(and am not particulary surprised about perl using the c library ;-)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
P.
However,
when $self is just some hash reverence ("my $self={}"), the code also works
without any problem.
Regards,
Peter Daum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
$t now retains its value from the last loop iteration.
Is this a bug or a feature (tm)?
If it is a feature, then why isn't the value also retained in the 1st example?
Regards,
Peter Daum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
polation) or
$s=~ s/\\(.)/"\\$1"/eg;
but somehow i couldn't get it right ...
Can anybody think of an elegant solution?
Regards,
Peter Daum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
... in the meantime, I discovered a solution, so let me answer
my own question in case somebody else stumbles on this.
Peter Daum wrote:
> I am trying to figure out a way to write data to a fifo without
> knowing whether there is a reader available and without ever blocking.
> What I&
ossible to ge a signal if data is available, but I can't
think of any way to get such a signal if the pipe is opened for
reading (so I could afterwards open it for writing).
Ainy ideas?
Regards,
Peter Daum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comman
and the output format. Using verbatim paragraphs would
mean doing without any formatting.
I'm afraid, the E<10> is about close as it gets...
Thanks a lot,
Peter Daum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Hi,
Is there any way, to force a line break in POD,
without starting a new paragraph?
Regards,
Peter Daum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Tom Phoenix wrote:
> On 8/5/06, Peter Daum <[EMAIL PROTECTED]> wrote:
>> $s =~ /^(.*[^\\])(\\)?$/; print "1: '$1', 2: '$2'";
>
> Let's see what that pattern matches by annotating it:
>
> m{
>^ # start of stri
he end.
When I do a chomp($s) first, everything behaves as expected,
while a "/m" at the end of the regular expression doesn't
make any difference.
Does anybody have an explanation what is going on here?
Regards,
Peter Daum
--
To unsubscribe, e-mail: [EMAI
25 matches
Mail list logo