Questions tagged [perl5.8]

perl5.8 refers to questions about that particular version of Perl. Perl 5.8 is officially unsupported.

Perl v5.8 was the longest lived version of Perl. It was released on July 2002, and the last version was released on December 2008.

Since then, Perl has been adding new features which won't work on this version. People stuck on this old version won't be able to use some of the answers that use features from a supported version of Perl.

30 questions
13
votes
2 answers

How to guess minimum perl version a particular script is written for?

I have a bunch of scripts that I wrote at times when I did not realize how use v1.2.3; can be useful. So some of them may be using features from later versions of perl, some of them may be OK with, say, perl 5.8. Now I would like to get that into…
Alois Mahdal
  • 10,763
  • 7
  • 51
  • 69
8
votes
1 answer

What's the difference in delayed evaluation of code in subroutines for Perl's 5.8 vs. 5.10 and 5.12?

This bit of code behaves differently under Perl 5.8 than it does under Perl 5.12: my $badcode = sub { 1 / 0 }; print "Made it past the bad code.\n"; When I run it under 5.8, I get an error even though I never execute the division: [brock@chase…
Brock
  • 330
  • 1
  • 6
7
votes
3 answers

Can I make sure Perl code written on 5.10+ will run on 5.8?

Some of the new features of Perl 5.10 and 5.12, such as "say", are defined as features, that you can enable or disallow explicitly using the "feature" pragma. But other additions, like the named capture groups of regexes, are implicit. When I write…
Thomas Kappler
  • 3,795
  • 1
  • 22
  • 21
6
votes
6 answers

Matching balanced parenthesis in Perl regex

I have an expression which I need to split and store in an array: aaa="bbb{ccc}ddd" { aa="bb,cc" { a="b", c="d" } }, aaa="bbb{}" { aa="b}b" }, aaa="bbb,ccc" It should look like this once split and stored in the array: aaa="bbb{ccc}ddd" { aa="bb,cc"…
meharo
  • 121
  • 3
  • 7
6
votes
10 answers

Which versions of Perl are you using?

According to the Perl source code page on CPAN, 5.8.9 is now 14 days old, and will be the last 5.8 release. 5.10.0 is over a year old and presumably ready for use in Production. Leaving aside discussion of Perl 6 for now, can I ask what versions of…
Anil
  • 3,912
  • 5
  • 35
  • 46
6
votes
4 answers

How do you store a result to a variable and check the result in a conditional?

I know it's possible but I'm drawing a blank on the syntax. How do you do something similar to the following as a conditional. 5.8, so no switch option: while ( calculate_result() != 1 ) { my $result = calculate_result(); print "Result is…
Oesor
  • 6,632
  • 2
  • 29
  • 56
5
votes
3 answers

Will all perl versions support older modules?

I'm have Perl 5.8 installed on all of our servers and wanted to use the DBI and DBD::Oracle modules to access our databases. My main concern is with the newer versions of perl the DBI and DBD modules will stop working with 5.8. Then I'd have to…
krizzo
  • 1,823
  • 5
  • 30
  • 52
5
votes
1 answer

Static local dispatch table with OO calls within closures

I have a dispatch table that I wish to initialize only once, and is only intended to be used by one function. I was hoping to move the dispatch table outside of the subroutine and into the same anonymous block, but since the dispatch table uses…
kei-clone
  • 329
  • 1
  • 2
  • 8
4
votes
3 answers

Perl Regex Variable Replacement printing 1 instead of desired extraction

Case 1: year$ = ($whole =~ /\d{4}/); print ("The year is $year for now!";) Output: The year is The year is 1 for now! Case 2: $whole="The year is 2020 for now!"; $whole =~ /\d{4}/; $year = ($whole); print ("The year is $year for now!";) Output:…
Eliana Lopez
  • 161
  • 1
  • 1
  • 8
4
votes
2 answers

Return only matches from substitution in Perl 5.8.8 (was: Perl "p" regex modifier equivalent)

I've got a script (source) to parse svn info to create a suitable string for Bash's $PS1. Unfortunately this doesn't work on one system I'm using which is running Perl 5.8.8 - It outputs all lines instead of only the matches. What would be the Perl…
l0b0
  • 55,365
  • 30
  • 138
  • 223
3
votes
1 answer

Mocking backticks operator in perl 5.8.8

I am trying to mock the backticks operator in perl version 5.8.8 . From what i have understood is, it is not possible to mock it in perl version 5.8.8. But in perl version 5.9 onward, i can easily mock the backticks operator using…
Niraj Nandane
  • 1,318
  • 1
  • 13
  • 24
2
votes
3 answers

how to port code perl switch-like statement for use with 5.8

I have this particular code that is using perl 5.10 (for switch-like operation), but need to get it to work on 5.8. What's another way to write this for 5.8? A preferred way/technique? for my $detail ($Details1, $Details2) { for (keys %$detail)…
cjd143SD
  • 859
  • 7
  • 17
  • 28
2
votes
1 answer

How to switch between versions of Perl 5.8 and 5.10 on Mac OS X 10.6 Server and using Apache2

The new Mac Mini Server comes with OS X 10.6 and natively supports (comes with) two versions of Perl and Apple has included these by default for good reason. These can be found under the following…
Dougpan
  • 87
  • 4
1
vote
1 answer

Unable to print after while loop in perl

BEGIN { use FindBin; $scriptsDir = $FindBin::RealBin; } sub print_log { ($log, $msg) = ($_[0], $_[1]); print $log $msg; } $opt_rh_gsr = "path_to_file"; open(FO, "$opt_rh_gsr") || die "-F-: Can not open file \n"; while() { …
1
vote
1 answer

How to return a json in a mini web server without any additional module?

So my problem is that i have a perl5.8 installation and i can't install any additional module. (I am a public servant and i have to use the servers as they are without any right on it or choosing what i can install on it, the process to modify…
bussirs
  • 21
  • 3
1
2