in reply to Re^2: Perl ODBC Drivers
in thread Perl ODBC Drivers

Yes, I'm aware and most often use -E. It was just early, and just in case someone tested it that doesn't have a recent enough version for say(). :) Good to point out for those who don't know. In a one-liner, say() is especially useful when iterating.

Replies are listed 'Best First'.
Re^4: Perl ODBC Drivers
by kcott (Archbishop) on Oct 29, 2015 at 06:17 UTC

    If print/say is the only issue, changing -E to -le will make print work the same as say. Furthermore, that will work in very old Perls (at least 5.6, but I expect much earlier).

    I often find I need to check the versions of multiple modules so I wrote this function for that:

    perlmodver () { for i in "$@"; do eval "echo \`perl -E 'no warnings q{deprecated}; use $i; say q +q{$i }, \$$i::VERSION'\`" done }

    Example usage:

    $ perlmodver DBD::ODBC DBD::SQLite DBI Can't locate DBD/ODBC.pm in @INC (you may need to install the DBD::ODB +C module) (@INC contains: /Users/ken/local/lib/perl /Users/ken/perl5/ +perlbrew/perls/perl-5.22.0t/lib/site_perl/5.22.0/darwin-thread-multi- +2level /Users/ken/perl5/perlbrew/perls/perl-5.22.0t/lib/site_perl/5.2 +2.0 /Users/ken/perl5/perlbrew/perls/perl-5.22.0t/lib/5.22.0/darwin-th +read-multi-2level /Users/ken/perl5/perlbrew/perls/perl-5.22.0t/lib/5. +22.0 .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. DBD::SQLite 1.46 DBI 1.633

    — Ken