[Israel.pm] Selective warnings use

Madani, Srikanth, VF-DE Srikanth.Madani at vodafone.com
Wed Feb 9 02:52:25 PST 2005


Hi all,

I have a script which needs to run a Linux box with Perl 5.8.1, and also
on a Solaris machine with Perl 5.0053.

The latter doesn't let me use the warnings pragma.

Can I check which Perl version is being used to compile/execute my
script and then act accordingly?


#!/usr/local/bin/perl
#Notice that I haven't used the "-w" flag
use strict;
use diagnostics;
use warnings if ($Check_if_warnings_pragma_is_available);
Use the "-w" flag, if warnings isn't available.







Cheers,
Srikanth Madani





More information about the Perl mailing list