Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Is there a command that will return the version of perl?

Reply
Thread Tools

Is there a command that will return the version of perl?

 
 
Guy
Guest
Posts: n/a
 
      12-02-2003
I am writing a perl script for someone. They gave me the address to one of
their unix servers and they created a couple of directories for me including
a cgi-bin where I can save my .cgi files (actually I was used to .pl files
but I guess they have to be .cgi on this server).

I upload my files to the server using FTP.
I can telnet to it but I think the only access I have is to my directories.

The server is about 3 hours away from here.

I was wondering, if my perl script can detect what version of perl it's
running on. whether it's perl 5.004, 5.6, or whatever.

Or is there an ENV value that I can pick up on it.

Thanks for all,

Guy Doucet


 
Reply With Quote
 
 
 
 
Sam Holden
Guest
Posts: n/a
 
      12-02-2003
On Tue, 02 Dec 2003 04:26:40 GMT, Guy <(E-Mail Removed)> wrote:
>
> I was wondering, if my perl script can detect what version of perl it's
> running on. whether it's perl 5.004, 5.6, or whatever.


perldoc perlvar

Particularly the descriptions of the $] and $^V variables.

--
Sam Holden
 
Reply With Quote
 
 
 
 
William Herrera
Guest
Posts: n/a
 
      12-02-2003
On Tue, 02 Dec 2003 04:26:40 GMT, "Guy" <(E-Mail Removed)> wrote:

>I am writing a perl script for someone. They gave me the address to one of
>their unix servers and they created a couple of directories for me including
>a cgi-bin where I can save my .cgi files (actually I was used to .pl files
>but I guess they have to be .cgi on this server).
>
>I upload my files to the server using FTP.
>I can telnet to it but I think the only access I have is to my directories.
>
>The server is about 3 hours away from here.
>
>I was wondering, if my perl script can detect what version of perl it's
>running on. whether it's perl 5.004, 5.6, or whatever.
>
>Or is there an ENV value that I can pick up on it.
>
>Thanks for all,
>
>Guy Doucet
>
>


I use this one once in a while. I don't know who write it originally (anybody
else know)? I only modified it a little.


<<<<<<<<<<<<<
#!/usr/bin/perl
## printenv -- demo CGI program which prints the cgi environment

use strict;
use CGI qw/:standard/;
use CGI::Carp 'fatalsToBrowser';

my $q = new CGI;
my $var;
my $val;

print $q->header, $q->start_html;

foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print $q->p("${var}=\"${val}\"\n");
}

print $q->p(`perl -v`);

print $q->end_html;

<<<<<<<<<<<<<
---
Use the domain skylightview (dot) com for the reply address instead.
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      12-02-2003
Guy wrote:
What about a simple "perl -v"?
[...]
> I was wondering, if my perl script can detect what version of perl
> it's running on. whether it's perl 5.004, 5.6, or whatever.


Well, you can always call "perl -v" from a Perl script using backticks to
capture the output..

jue


 
Reply With Quote
 
Gregory Toomey
Guest
Posts: n/a
 
      12-02-2003
It was a dark and stormy night, and Guy managed to scribble:

> I am writing a perl script for someone. They gave me the address to one of
> their unix servers and they created a couple of directories for me
> including a cgi-bin where I can save my .cgi files (actually I was used to
> .pl files but I guess they have to be .cgi on this server).
>
> I upload my files to the server using FTP.
> I can telnet to it but I think the only access I have is to my
> directories.
>
> The server is about 3 hours away from here.
>
> I was wondering, if my perl script can detect what version of perl it's
> running on. whether it's perl 5.004, 5.6, or whatever.
>
> Or is there an ENV value that I can pick up on it.
>
> Thanks for all,
>
> Guy Doucet


$] contains the version number.
print $];

For a full list of special variables see http://www.rexswain.com/perl5.html

gtoomey
 
Reply With Quote
 
Iain Chalmers
Guest
Posts: n/a
 
      12-02-2003
In article <2525430.M6Wg5aDTAh@gregs-web-hosting-and-pickle-farming>,
Gregory Toomey <(E-Mail Removed)> wrote:

> Guy wrote:
> >
> > I was wondering, if my perl script can detect what version of perl it's
> > running on. whether it's perl 5.004, 5.6, or whatever.

>
> $] contains the version number.
> print $];
>
> For a full list of special variables see http://www.rexswain.com/perl5.html


Or even (from a command line):

perldoc perlvar

it magically works even without a net connection!



big

--
'When I first met Katho, she had a meat cleaver in one hand and
half a sheep in the other. "Come in", she says, "Hammo's not here.
I hope you like meat.' Sharkey in aus.moto
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
command equivalent in PIX version 6.3 for the version 7.x command: same-security-traffic permit inter-interface Mike Rahl Cisco 6 12-12-2006 10:19 PM



Advertisments