[30827] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2072 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 22 11:09:47 2008

Date: Mon, 22 Dec 2008 08:09:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 22 Dec 2008     Volume: 11 Number: 2072

Today's topics:
    Re: confused a little by use strict <Peter@PSDT.com>
        How to get text from PDF? <mirzashahidmahmood@gmail.com>
    Re: How to get text from PDF? <sbryce@scottbryce.com>
    Re: How to get text from PDF? <smallpond@juno.com>
        new CPAN modules on Mon Dec 22 2008 (Randal Schwartz)
    Re: Non-OO interface to mysql <uri@stemsystems.com>
    Re: Non-OO interface to mysql <hjp-usenet2@hjp.at>
    Re: Non-OO interface to mysql <klaus03@gmail.com>
    Re: Non-OO interface to mysql <hjp-usenet2@hjp.at>
    Re: Non-OO interface to mysql <bernie@fantasyfarm.com>
    Re: printing out the current URL for current ASP page i <jurgenex@hotmail.com>
    Re: printing out the current URL for current ASP page i <tadmc@seesig.invalid>
    Re: Why in perl system(" ") command, "source command_fi <tadmc@seesig.invalid>
        Why in perl system(" ") command, "source command_file"  <chen_zhitao@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 22 Dec 2008 10:18:58 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: confused a little by use strict
Message-Id: <mQJ3l.3$701.0@newsfe12.iad>

On Sun, 21 Dec 2008 16:58:21 +0000, dan wrote:
> use strict;
> 
> my $foo = 0;
> 
> for $foo (0,1) {
>   print "$foo\n";
> }
> 
> print "$foo\n";
> 
> outputs
> 
> 0
> 1
> 0
> 
> So $foo comes out of the loop unchanged. OK, if thats how it works, then
> why complain if I write
> 
> use strict;
> 
> my $foo = 0;
> 
> for $mistake (0,1) {
>   print "$foo\n";
> }
> 
> print "$foo\n";
> 
> which outputs
> Global symbol "$mistake" requires explicit package name ...?
> 
> Since it complains, this implies that in the first case, $foo would come
> out of the loop with value 1, doesn't it?

Your contention appears to be that since perl uses a 'temporary' variable 
for the foreach iterator, shouldn't 'use strict' give it a pass if it's 
not declared?  The foreach semantics have evolved over the years and the 
counterclaims to your argument are not as strong as they once were, but 
nevertheless, at this point, perl elects to prefer to be consistent with 
the "fully specify (or 'use vars') all package variables when using 
strict" rule.  Notice that if we turn strict off, we can see that perl 
uses the package variable for the iterator if there's no lexical of the 
same name (rather thab creating a new lexical):

$::foo = 'package';
for $foo ( 42 ) {
  print "Package = $::foo\n";
}

# Package = 42

Just always say "for my ..." and you won't be bothered by these issues.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


------------------------------

Date: Mon, 22 Dec 2008 07:06:58 -0800 (PST)
From: Shahid <mirzashahidmahmood@gmail.com>
Subject: How to get text from PDF?
Message-Id: <5a871026-71a0-45cb-88f1-4074a468f12d@a26g2000prf.googlegroups.com>

Hi all,

I have my web server bases on linux. I am working on a project for
which I need to get text out of PDF file. I need to know which text
belongs to which PDF page number?

Is there any utility/tool that should be installed on linux and I can
use it from command line in PHP through exec() or system() etc for
this purpose?

Please reply me urgently.

Thanks in advance.


------------------------------

Date: Mon, 22 Dec 2008 08:31:26 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: How to get text from PDF?
Message-Id: <giobsr$n4m$1@news.motzarella.org>

Shahid wrote:
> Hi all,
> 
> I have my web server bases on linux. I am working on a project for 
> which I need to get text out of PDF file. I need to know which text 
> belongs to which PDF page number?
> 
> Is there any utility/tool that should be installed on linux and I can
> use it from command line in PHP through exec() or system() etc for 
> this purpose?

What you want to do may not be possible. comp.text.pdf would be a better
place to ask.


------------------------------

Date: Mon, 22 Dec 2008 08:01:27 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: How to get text from PDF?
Message-Id: <6a3757f3-f817-43a9-ae56-bfddff56e5e1@l38g2000vba.googlegroups.com>

On Dec 22, 10:06 am, Shahid <mirzashahidmahm...@gmail.com> wrote:
> Hi all,
>
> I have my web server bases on linux. I am working on a project for
> which I need to get text out of PDF file. I need to know which text
> belongs to which PDF page number?
>
> Is there any utility/tool that should be installed on linux and I can
> use it from command line in PHP through exec() or system() etc for
> this purpose?
>
> Please reply me urgently.
>
> Thanks in advance.


There is a module on CPAN called PDF::OCR::Thorough which attempts
to extract text from pdf docs.  I've never used it and it looks like
a fair amount of work to set up.  If the pdf file has a known simple
structure, there may be easier ways.


------------------------------

Date: Mon, 22 Dec 2008 05:42:25 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Dec 22 2008
Message-Id: <KC9Jup.42C@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-CPANAuthors-Italian-0.01
http://search.cpan.org/~acalpini/Acme-CPANAuthors-Italian-0.01/
We are Italian CPAN Authors 
----
Alien-Judy-0.03
http://search.cpan.org/~jjore/Alien-Judy-0.03/
----
App-PPBuild-0.03
http://search.cpan.org/~exodist/App-PPBuild-0.03/
Perl Project Build System 
----
App-Rad-0.8
http://search.cpan.org/~garu/App-Rad-0.8/
Rapid (and easy!) creation of command line applications 
----
Audio-Extract-PCM-0.02_02
http://search.cpan.org/~pepe/Audio-Extract-PCM-0.02_02/
Extract PCM data from audio files 
----
Audio-Ofa-0.02_02
http://search.cpan.org/~pepe/Audio-Ofa-0.02_02/
Perl interface to libofa, an Acoustig Fingerprinting library 
----
B-Generate-1.16
http://search.cpan.org/~rurban/B-Generate-1.16/
Create your own op trees. 
----
CPANPLUS-Dist-RPM-0.0.7
http://search.cpan.org/~rsrchboy/CPANPLUS-Dist-RPM-0.0.7/
a CPANPLUS backend to build RPM 
----
Chart-Clicker-2.17
http://search.cpan.org/~gphat/Chart-Clicker-2.17/
Powerful, extensible charting. 
----
Curses-UI-0.9607
http://search.cpan.org/~mdxi/Curses-UI-0.9607/
A curses based OO user interface framework 
----
DBIx-Connection-0.11
http://search.cpan.org/~adrianwit/DBIx-Connection-0.11/
Simple database interface. 
----
DBIx-Connection-0.12
http://search.cpan.org/~adrianwit/DBIx-Connection-0.12/
Simple database interface. 
----
Data-Util-0.44
http://search.cpan.org/~gfuji/Data-Util-0.44/
A selection of utilities for data and data types 
----
Devel-StackTrace-WithLexicals-0.02
http://search.cpan.org/~sartak/Devel-StackTrace-WithLexicals-0.02/
Devel::StackTrace + PadWalker 
----
Fatal-Exception-0.04
http://search.cpan.org/~dexter/Fatal-Exception-0.04/
succeed or throw exception 
----
Jifty-Plugin-Authentication-Bitcard-0.053
http://search.cpan.org/~jhelwig/Jifty-Plugin-Authentication-Bitcard-0.053/
Bitcard authentication plugin 
----
Judy-HS-0.07
http://search.cpan.org/~jjore/Judy-HS-0.07/
Library for creating and accessing a dynamic array, using an array-of-bytes as an Key and a word as a Value. 
----
Markapl-0.04
http://search.cpan.org/~gugod/Markapl-0.04/
Markup as Perl 
----
Markapl-0.05
http://search.cpan.org/~gugod/Markapl-0.05/
Markup as Perl 
----
Net-ASN-1.06
http://search.cpan.org/~dfreedman/Net-ASN-1.06/
Perl extension for manipulating autonomous system numbers 
----
Net-Google-PicasaWeb-0.05
http://search.cpan.org/~hanenkamp/Net-Google-PicasaWeb-0.05/
use Google's Picasa Web API 
----
PPBS-1.01
http://search.cpan.org/~exodist/PPBS-1.01/
Perl Project Build System 
----
Padre-Plugin-Parrot-0.22
http://search.cpan.org/~szabgab/Padre-Plugin-Parrot-0.22/
Experimental Padre plugin that runs on Parrot 
----
Padre-Plugin-Perl6-0.011
http://search.cpan.org/~azawawi/Padre-Plugin-Perl6-0.011/
Padre plugin for Perl6 
----
Parse-Eyapp-1.136
http://search.cpan.org/~casiano/Parse-Eyapp-1.136/
Extensions for Parse::Yapp 
----
Perlwikipedia-1.5.1
http://search.cpan.org/~dcollins/Perlwikipedia-1.5.1/
a Wikipedia bot framework written in Perl 
----
Pod-Manual-0.08_03
http://search.cpan.org/~yanick/Pod-Manual-0.08_03/
Aggregates several PODs into a single manual 
----
Quota-1.6.3
http://search.cpan.org/~tomzo/Quota-1.6.3/
Perl interface to file system quotas 
----
RTx-Tags-0.10
http://search.cpan.org/~jpierce/RTx-Tags-0.10/
Tag Cloud support for RT with simple-searchable custom fields. 
----
SQL-Abstract-Limit-0.13
http://search.cpan.org/~davebaird/SQL-Abstract-Limit-0.13/
portable LIMIT emulation 
----
Scalar-Random-0.01
http://search.cpan.org/~alfie/Scalar-Random-0.01/
Convert scalar variables into automatic random number generators 
----
Simo-0.01_03
http://search.cpan.org/~kimoto/Simo-0.01_03/
Very simple framework for Object Oriented Perl. 
----
Sub-Alias-0.01
http://search.cpan.org/~gugod/Sub-Alias-0.01/
Simple subroutine alias. 
----
Sys-Mmap-Simple-0.03_1
http://search.cpan.org/~leont/Sys-Mmap-Simple-0.03_1/
Memory mapping made simple and safe. 
----
TL1Toolkit-0.01
http://search.cpan.org/~rvdp/TL1Toolkit-0.01/
Utility functions for interacting with TL1 equipment 
----
Task-Padre-Plugin-Deps-0.05
http://search.cpan.org/~fayland/Task-Padre-Plugin-Deps-0.05/
prereqs of Padre::Plugins 
----
Task-Padre-Plugins-0.06
http://search.cpan.org/~fayland/Task-Padre-Plugins-0.06/
Get many Plugins of Padre at once 
----
Test-DBUnit-0.16
http://search.cpan.org/~adrianwit/Test-DBUnit-0.16/
Database test framework. 
----
Text-EditTranscript-0.03
http://search.cpan.org/~lmetcalf/Text-EditTranscript-0.03/
Perl extension for determining the edit transcript between two strings 
----
Tk-Tree-XML-0.01
http://search.cpan.org/~santos/Tk-Tree-XML-0.01/
XML tree widget 
----
Tk-XMLTree-0.03
http://search.cpan.org/~santos/Tk-XMLTree-0.03/
An XML tree widget 
----
WWW-Amazon-Wishlist-1.501
http://search.cpan.org/~mthurn/WWW-Amazon-Wishlist-1.501/
grab all the details from your Amazon wishlist 
----
WWW-Amazon-Wishlist-1.6
http://search.cpan.org/~mthurn/WWW-Amazon-Wishlist-1.6/
grab all the details from your Amazon wishlist 
----
WWW-PivotalTracker-0.1.0_2
http://search.cpan.org/~jhelwig/WWW-PivotalTracker-0.1.0_2/
The great new WWW::PivotalTracker! 
----
WWW-PivotalTracker-0.1.0_3
http://search.cpan.org/~jhelwig/WWW-PivotalTracker-0.1.0_3/
The great new WWW::PivotalTracker! 
----
Wiki-Toolkit-Plugin-RSS-Reader-1.6
http://search.cpan.org/~dom/Wiki-Toolkit-Plugin-RSS-Reader-1.6/
retrieve RSS feeds for inclusion in Wiki::Toolkit nodes 
----
pake-0.2
http://search.cpan.org/~izi/pake-0.2/
----
ppbuild
http://search.cpan.org/~exodist/ppbuild/
Perl Project Build System 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


------------------------------

Date: Sun, 21 Dec 2008 22:26:13 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Non-OO interface to mysql
Message-Id: <x77i5sq4a2.fsf@stemsystems.com>

>>>>> "LE" == Lars Eighner <usenet@larseighner.com> writes:

  >> just turn your head around and the arrows point in the right way. you
  >> have a strange view of coding if that is what really bothers you. don't
  >> go near c

  LE> I think you mean c++, not the same thing as c.

and that is your useful comment to my post? begone with ye and code no
more.

btw, i have done procedural code in many langs as well as OO style code
in assembler and C. i have wrapped OO modules in perl into procedural
things and there is even a module out there that can do that for you.

basically it comes down to you unsupportable fears. if you want help
with perl coding, ask it here. to conquer you fears, seek therapy.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Mon, 22 Dec 2008 13:04:36 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Non-OO interface to mysql
Message-Id: <slrngkv0io.s4g.hjp-usenet2@hrunkner.hjp.at>

On 2008-12-21 23:31, Lars Eighner <usenet@larseighner.com> wrote:
> In our last episode, <qjr226xg7u.ln2@goaway.wombat.san-francisco.ca.us>, the
> lovely and talented Keith Keller broadcast on comp.lang.perl.misc:
>> On 2008-12-21, Lars Eighner <usenet@larseighner.com> wrote:
>>> In our last episode, 
>>><Itf3l.18820$iY3.12303@newsfe14.iad>, 
>>> the lovely and talented Tim Greer 
>>> broadcast on comp.lang.perl.misc:
>>>
>>>> However, I don't see a reason to seek such a thing out, just to avoid OO
>>>> (so I assume there's more to the question),
>>>
>>> The idea is precisely to avoid OO (best) or at least to have function type
>>> calls (second best).
>
>> What exactly do you hope to gain by avoiding OO?
>
> 1) The horrible slowness and waste of resources.

If you care about that, why are you coding in Perl? Compared to any
language that compiles to native code (even indirectly via a
JIT-compiler, like most Java implementations) it's horribly slow. And
compared to any language which uses an explicit type system, it's a
horrible waste of computer resources. (But it frees a lot of human
resources, and for a given time budget, the Perl programmer may even be
able to write a faster and less resource-intensive program than the C
programmer).

Now, let's do a little reality check on the "horrible slowness":


#!/usr/bin/perl
use warnings;
use strict;

use Benchmark 'cmpthese';

my $phandle = 23;
my $ohandle = MyClass->new();
my $arg = "this is an argument";

cmpthese(-3,
	{
        'proc' => sub { foo($phandle, $arg) },
	'oo'   => sub { $ohandle->foo($arg) },
        });


sub foo {
    my ($handle, $arg) = @_;
    return $arg;
}


package MyClass;

sub new {
    my ($class) = @_;
    my $self = {};
    return bless $self, $class;
}

sub foo {
    my ($self, $arg) = @_;
    return $arg;
}
__END__

This little program compares a "procedural" subroutine call with an
oo-style method call.

         Rate   oo proc
oo   783445/s   --  -7%
proc 838852/s   7%   --

Hooray, procedural calls are 7 percent faster. That's a whopping 84
nanoseconds per call. But let's run it again:

         Rate proc   oo
proc 786957/s   --  -7%
oo   842802/s   7%   --

Oh, this time oo is 7 percent faster.

If you repeat that a few times you will see that in about 50 % of the
cases the procedural call is slightly faster than the oo call and in
50 % of the cases the oo call is slightly faster - or in other words,
the difference is not even measurable with a simple benchmark.

	hp



------------------------------

Date: Mon, 22 Dec 2008 04:53:22 -0800 (PST)
From: Klaus <klaus03@gmail.com>
Subject: Re: Non-OO interface to mysql
Message-Id: <604fcef9-ce6b-43c9-a08f-8b54dbe69d9f@t26g2000prh.googlegroups.com>

On Dec 21, 8:53=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2008-12-21 16:03, Lars Eighner <use...@larseighner.com> wrote:
>
> > In our last episode,
> ><ae0da84f-860f-4c55-8efe-637ea06e1...@s9g2000prm.googlegroups.com>, the
> > lovely and talented skeldoy broadcast on comp.lang.perl.misc:
> >> On Dec 20, 10:55=A0pm, Lars Eighner <use...@larseighner.com> wrote:
> >>> Just another in a series of periodic requests asking if anyone has ru=
n
> >>> across a non-OO interface to MySQL.
>
> >> You could always create a security nightmare/spaghetti-nest by
> >> invoking the mysql-tool from backticks.. ;)
> >> `mysql -u root database -e "select * from table;"` or something to
> >> that accord.
>
> > Well, yes, that's how I will go if I have to build it myself. =A0What I=
 asking
> > is if the functions for parsing the return already exist somewhere.
>
> Oh my god. That's really the worst way to implement it.
>
> Write simple wrapping functions around DBI, if you prefer to write
> =A0 =A0 $rows =3D mysql_selectall_arrayref($dbh, "select * from table");
> instead of
> =A0 =A0 $rows =3D $dbh->selectall_arrayref("select * from table");

No need to write wrapper functions. A plain...

    $rows =3D DBI::mysql_selectall_arrayref($dbh, "select * from
table");

 ...should work.

--
Klaus


------------------------------

Date: Mon, 22 Dec 2008 14:39:50 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Non-OO interface to mysql
Message-Id: <slrngkv656.t9p.hjp-usenet2@hrunkner.hjp.at>

On 2008-12-22 12:53, Klaus <klaus03@gmail.com> wrote:
> On Dec 21, 8:53 pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:

[Non-OO DB interface]

>> Write simple wrapping functions around DBI, if you prefer to write
>>     $rows = mysql_selectall_arrayref($dbh, "select * from table");
>> instead of
>>     $rows = $dbh->selectall_arrayref("select * from table");
>
> No need to write wrapper functions. A plain...
>
>     $rows = DBI::mysql_selectall_arrayref($dbh, "select * from
> table");
>
> ...should work.

No, because $dbh is not an object of the class DBI, but of the class
DBI::db.
DBI uses quite a lot of classes internally, and several of them depend
on the DBD driver actually in use, so you generally don't know (and
shouldn't care) which class an object belongs to (just which interface
it implements, to borrow some terminology from Java).

	hp


------------------------------

Date: Mon, 22 Dec 2008 10:36:36 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Non-OO interface to mysql
Message-Id: <i8cvk45u4bcmj15csqnrdg8o5ruq75gtfe@library.airnews.net>

Lars Eighner <usenet@larseighner.com> wrote:

} In our last episode, <qjr226xg7u.ln2@goaway.wombat.san-francisco.ca.us>, the
} lovely and talented Keith Keller broadcast on comp.lang.perl.misc:

} > What exactly do you hope to gain by avoiding OO?
} 
} 2) Little ASCII art pictures of arrows in code (especially where the arrows
} point the counterintuitive way)

That's basically trivial to get rid of -- I did that long ago.  I just set
up

use vars qw($database) ;
sub connect
{  $database = DBI-connect-to-dtabase }

sub doSelect
{
  my ($prepare) = @_ ;

  my $statement = $database->prepare($prepare) ;
  errorMsg ("Error with database: ". $database->errstr." from $prepare")
      if !$statement ;
  errorMsg ("Error with database: ". $database->errstr." from $prepare")
      if !$statement->execute() ;
  return $statement ;
}

Granted that I do do the little-arrows for fetching:
   my $stmt = doSelect("SELECT * from table1 ORDER BY foo") ;
   while (my $row = $stmt->fetchrow_arrayref())
   { ... }

But it would be easy to do 
   while (my $row = getrow($stmt))

with the obvious:
   sub getrow
   {  return $stmt->fetchrow_arrayref(); }

so I think it is pretty easy to 'hide' the oo-ness of DBI if you want to.. 

I do that kind of thing more seriously to do higher-level like things.
e.g., I have a "dopopup(table, FIELD)" that does the doselect, builds the
array and hash it takes to make popup_menu in the CGI module happy and then
returns the HTML, so I can just dump a dropdown from my table into my HTML
with no [visible! :o)] code or messiness in my CGI pgm.

It is easier, IMO, to make 'functional enhancements' to an OO package than
it is to make 'oo enhancements' to a functional package.

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


------------------------------

Date: Sun, 21 Dec 2008 17:43:05 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: printing out the current URL for current ASP page in Perl
Message-Id: <tprtk4pubevkkc1em3ggkam6h00q5qan73@4ax.com>

Jack <jack_posemsky@yahoo.com> wrote:
>Hi I am using ASP and Perl and printing the hash %ENV does nothing, 

Well, there could be a few reasons:
- %ENV is empty. This is possible but highly unlikely unless you
deliberately emptied it.
- print() has a bug. While not completely impossible this is extremely
unlikely and would require quite some supporting evidence.
- you are looking at the wrong place, i.e. you are not looking where
print() is printing.

You might also be print()ing to a closed file handle, but in that case
you would get an error message "print() on closed filehandle" instead of
nothing.

jue


------------------------------

Date: Mon, 22 Dec 2008 08:35:24 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: printing out the current URL for current ASP page in Perl
Message-Id: <slrngkv9dc.u7u.tadmc@tadmc30.sbcglobal.net>

Jürgen Exner <jurgenex@hotmail.com> wrote:
> Jack <jack_posemsky@yahoo.com> wrote:
>>Hi I am using ASP and Perl and printing the hash %ENV does nothing, 
>
> Well, there could be a few reasons:

[ snip some reasons ]

> You might also be print()ing to a closed file handle, but in that case
> you would get an error message "print() on closed filehandle" instead of
                   ^^^^^^^^^^^^^
> nothing.


That is a _warning_ message, so you'd get nothing if warnings
were not enabled.

(But warnings should always be enabled when developing Perl code.)


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Mon, 22 Dec 2008 08:29:26 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Why in perl system(" ") command, "source command_file" does nothing,  but "source command_file && echo" works?
Message-Id: <slrngkv926.u7u.tadmc@tadmc30.sbcglobal.net>

Kuhl <chen_zhitao@yahoo.com> wrote:
> Hi, in my Perl script,
>
> system("source command_file");
>     does nothing.


You should always enable warnings when developing Perl code.


> But
> system("source command_file && echo");
>     works correctly.
>
> How come?


Because "source" is a shell built-in and the 1st call does not
invoke a shell (because it is a single arg with no shell metachars).

    perldoc -f system


Either give system() a list of args that calls the shell you want:

    system("/bin/sh", "-c", "source command_file");

or give system() a single arg that contains a shell metachar:

    system("source command_file;");


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Mon, 22 Dec 2008 06:09:20 -0800 (PST)
From: Kuhl <chen_zhitao@yahoo.com>
Subject: Why in perl system(" ") command, "source command_file" does nothing,  but "source command_file && echo" works?
Message-Id: <5743e1b4-fc18-417a-98ba-e48b864c85a5@z28g2000prd.googlegroups.com>

Hi, in my Perl script,

system("source command_file");
    does nothing.

But
system("source command_file && echo");
    works correctly.

How come?

BTW, the command_file looks like below:

calibre -query << ! | tee log_file
filter layers lay_bond_pad
net shapes AGNDP
filter layers lay_bond_pad
net shapes DM
filter layers lay_bond_pad
net shapes DP
filter layers lay_bond_pad
net shapes VDD
!

This is using the soft ware Calibre Query Server of Mentor Graphics.

Thank you in advance.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 2072
***************************************


home help back first fref pref prev next nref lref last post