Questions tagged [perl5.8]
perl5.8 refers to questions about that particular version of Perl. Perl 5.8 is officially unsupported.
30
questions
0
votes
0
answers
77
views
Unable to execute SQL script in Perl
I'm trying to execute SQL script that has lot of DML commands using Perl.
Basically there is some reference number which is required to be updated every time in SQL script before it executes, so I'm ...
1
vote
1
answer
80
views
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, "$...
0
votes
1
answer
90
views
How to generate output files of excel format for each column of A i.e output files for App and Data each using perl code
This is the input file which is of excel format:
A
B
C
D
APP
1
210101
8.1
APP
2
210102
8.2
APP
3
210103
8.3
Data
4
210104
8.4
Data
5
210105
8.5
Data
6
210106
8.6
How to generate output files ...
4
votes
3
answers
77
views
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}/;...
0
votes
2
answers
1k
views
How to replace all characters in a string with '*' in perl
How to get a regular expression to replace all characters in a string in perl with *? The string has some utf-8 or iso-8859-1 characters also. I tried with "s/\w/*/g". But it did not replace utf-8 or ...
1
vote
1
answer
204
views
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 ...
0
votes
2
answers
110
views
How to correctly import a function from a custom module
I need some clue on how to import correctly a function from a custom module in perl. (here person_init from the PersonInit module).
This is my folder representation :
TestObject.pl
Person/Person.pm
...
1
vote
2
answers
450
views
Perl: not an array reference while calculating array size
I'm trying to untangle some legacy code where an operation is done on $value iff its size is more than x (where x is a hard coded int). This is what it currently looks like:
if (scalar(@{$value}) >...
0
votes
1
answer
471
views
MongoDB cursor to hash in Perl
So, I'm retrieving some values from MongoDB. I now that find method returns a cursor, which lazy loads the query results. I want to have the cursor stored as a hash, but I can find any method. Of ...
0
votes
2
answers
150
views
combine keys of hashes for output (outer join of hashes)
I'm analysing a log file with Perl 5.8.8.[1] I'm searching for days that expose some of two trigger patterns, maybe one of it, maybe both (I changed the actual patterns in the code snippet shown below)...
3
votes
1
answer
149
views
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 ...
1
vote
1
answer
1k
views
Variable $self in Perl is undefined
I am writing a Perl script which makes use of a Perl module, Module.pm.
Module.pm is like so:
package Module;
use strict;
use warnings;
sub getInfo {
my $self = shift;
#my $var = shift;
...
0
votes
1
answer
53
views
Which Subversion is bundled with Perl 5.8.8?
It seems to me that msysGit uses Perl 5.8.8.
Accordingly to upgrade Subversion I would like to know:
which Perl/Subversion bindings is bundled with Perl 5.8.8?
which Subversion version is bundled ...
1
vote
2
answers
56
views
How to match a string after a character when the line begins with one of two values?
I have a text file that's in the following format:
# Email File
# List of email addresses
##############################
PRIMARY_EMAIL=abc@123.com
ALTERNATE_EMAIL=123@abc.com
#PRIMARY_EMAIL=def@456....
-1
votes
2
answers
1k
views
How can I increment a hex string in Perl 5.8?
I have a large hex number - $num = 0x80000000, as a string.
I want to increment it, but doing hex($num) does not work, due to integer overflow (comes out negative). using bigint is also not an option ...
5
votes
1
answer
116
views
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 ...
-4
votes
2
answers
3k
views
Difference between perl 5.8 and 5.10 [closed]
I'm compiling some information related to the differences between 5.8 and 5.10. Can someone please point out the major differences, or tell me where I can begin my research?
0
votes
1
answer
583
views
How to ignore warnings using Net::Telnet::Cisco in Perl 5.8?
I installed. Net::telnet::cisco module in Perl 5.8 and trying to do following:
my $session = Net::Telnet::Cisco->new(Host=>'192.168.1.1',Ignore_warnings=>1);
But this doesn't seem to work ...
-2
votes
1
answer
404
views
creating and maintaining local repository ActiveState Perl
We are still continuing with ActiveState Perl 5.8. We are using lot of modules which were shipped with perl 5.8. Many of these modules has come up with new version with latest perl.
This task has ...
13
votes
2
answers
240
views
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, ...
5
votes
3
answers
2k
views
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 ...
6
votes
6
answers
7k
views
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 ...
2
votes
3
answers
190
views
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 ...
4
votes
2
answers
953
views
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 ...
2
votes
1
answer
2k
views
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 ...
7
votes
3
answers
361
views
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 ...
8
votes
1
answer
278
views
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 ...
6
votes
4
answers
148
views
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 $...
1
vote
3
answers
355
views
Would installing Perl 5.8.x or 5.10.x make a big impact on how my code runs if it was developed in 5.6.x?
What are the impacts (If any) by developing code in Perl 5.6.1 but running the code in Perl 5.8.x or 5.10.x?
I'm using these modules:
(For Linux)
HTTP::Request
HTTP::Response
LWP::UserAgent
Unicode::...
6
votes
10
answers
932
views
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 ...