Re: Listing files and their sizes

2007-09-18 Thread useperl-jeff

--- Telemachus Odysseos <[EMAIL PROTECTED]> wrote:

> 
> #!/usr/bin/perl
> 
> opendir(CD,"/path/to/directory/here");
> while ( $_ = readdir(CD)) {
> next if $_ eq "." or $_ eq "..";
> print $_, " " x (30-length($_));
> print (-s $_ );

Here you need to specify the absolute path for the files.
print -s "/path/to/dir/$_";

> print "\n";
> }
> 



  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Getting error with make while installing the module

2007-09-18 Thread useperl-jeff

--- kilaru rajeev <[EMAIL PROTECTED]> wrote:

> 
> *cc* is installed at */usr/ucb/cc* but it is pointing to *
> /opt/SUNWspro/bin/cc.* Please help me to make it point to the
> /usr/bin/cc.
> 

You may take a look at Makefile.PL and change something about the
complier.
But as a fast solution,how about making a symbol link from /usr/ucb/cc to
/opt/SUNWspro/bin/cc?

--
Jeff Pang



  

 Get the World's number 1 free email service.  
http://mail.yahoo.com.au 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: How to connect MS Access with ODBC

2007-09-19 Thread useperl-jeff

--- herostar1981 <[EMAIL PROTECTED]> wrote:

> Hi all,
>I am meeting a big problem.
> I try to use Perl to connect MS Access database from a remote
> machine .
> But I can not find a good way.
> I want use the DSN-less way.
> I search it from google, and get this example:
> use DBI;
> $dbh = DBI->connect('dbi:ODBC:driver=Microsoft Access Driver
> (*.mdb);dbq=f:\db1.mdb');
> 
> My question is how to setup the host name or port number?
> Like this:
> $dbh = DBI->connect('dbi:ODBC:driver=Microsoft Access Driver
> (*.mdb);ServerPort:128.128.110.110;dbq=f:\db1.mdb');
> , right?
> or replace ServerPort with HOST?


AFAIK,MS Access is a local file-based database,which doesn't have ports
listening.How can you access it from remote host via connecting to its
non-exist port?
You can check the document for DBD::ODBC,
http://search.cpan.org/~mjevans/DBD-ODBC-1.14/ODBC.pm

--
Jeff Pang




  

 Feel safe with award winning spam protection on Yahoo!7 Mail.  
www.yahoo.com.au/mail 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: How to connect MS Access with ODBC

2007-09-19 Thread useperl-jeff

--- herostar1981 <[EMAIL PROTECTED]> wrote:
> But I search "connect remote ms access database" from google.
> I get these results:
>http://www.google.com/search?q=connect+remote+ms+access+database%22&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

>From the url I got,

strConString = "Provider=MS Remote;" & _
   "Remote Server=http://192.168.1.1;"; & _
   "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=MyRemoteDB;Persist Security Info=False"


They connect to remote MS Access with http protocal,and you have to run
IIS on that Access host.


  

 Get the World's number 1 free email service.  
http://mail.yahoo.com.au 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Environment variable evaluation in a conditional

2007-09-20 Thread useperl-jeff

--- [EMAIL PROTECTED] wrote:

> I am currently trying to write a Perl program in a Solaris 9
> environment
> I am trying to process a list of variables with UNIX environment
> variables embedded in them of the form
> $dir_to_check = "$ENV_VAR1/some_dir/$ENV_VAR2/another_dir";
> and I am trying to find if another_dir exists, so I have a line of
> code that tries to do something like this:
> 
> if (-e $dir_to_check) { do some stuff }
> 

Hi,

It's `-d dir` for directory exist test.
`-e` is for file exist test.


  

 Get the World's number 1 free email service.  
http://mail.yahoo.com.au 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Environment variable evaluation in a conditional

2007-09-20 Thread useperl-jeff

--- Rob Dixon <[EMAIL PROTECTED]> wrote:


> > 
> > It's `-d dir` for directory exist test.
> > `-e` is for file exist test.
> 
> Not really. It's
> 
>   -e for item exists
>   -d for item exists and is a directory
>   -f for item exists and is a plain file
> 

Sorry,my mistake.You're right.



  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: White space split

2007-09-20 Thread useperl-jeff

--- [EMAIL PROTECTED] wrote:

> Hello,
> 
> I am trying to do this
> 
> #!/bin/perl
> $cmd="maheshverama   #XX#";
> $cmd1=split /\s+/,$cmd;
> print $cmd1;
> 
> Wanted the first part to be taken its giving me some numbers as output.
> 

Hello,

because split return a list,which is expressed as a number when in scalar
context.This number is the list's length.
you may do,
my ($cmd1) = split/\s+/,$cmd;

($cmd1) force it to be in list context,and get the correct value.




  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




RE: White space split

2007-09-20 Thread useperl-jeff

--- Andrew Curry <[EMAIL PROTECTED]> wrote:

> Split returns an array 

returns a list not array.
see `perldoc -q "What is the difference between a list and an array?"`



  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: RE: White space split

2007-09-20 Thread useperl-jeff

--- [EMAIL PROTECTED] wrote:

> Thanks Andrew and Jeff.
> ($cmd1, $rest)=split/\s+/,cmd$; worked for me. 
> my ($cmd1) = split/\s+/,$cmd;  is still giving me the length...
> I wanted to use something like above ...

you may type something wrong?see the test,

$ cat t3.pl 
my $cmd = "maheshverama   #XX#";
my ($cmd1) = split /\s+/,$cmd;
print $cmd1;

$ perl t3.pl 
maheshverama


  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: RE: White space split

2007-09-20 Thread useperl-jeff

--- yitzle <[EMAIL PROTECTED]> wrote:

> Note: split splits on whitespace by default, so these two are the same:
> split /\s+/, @array;
> split @array;
> 

Not right.You split a string,not an array or a list.
all below are wrong:
split @array;
split (11,22,33);
split $string;

see `perldoc -f split`.


  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: unix commands

2007-09-20 Thread useperl-jeff

--- lerameur <[EMAIL PROTECTED]> wrote:

> Hello,
> 
>  I want to write a perl script that invokes unix command. Some of the
> command can take a long time to process, I have many commands I want
> to invoke. Lets say the first command can take  one minute to
> process,  how can I make sure the second command will not start until
> the irst one is complete,
> 

Hi,

This is really descided by your application,not perl itself.
say you do something like,
system("/path/bin/httpd");
no one then would know when apache will exit.

if your first command is working in front-end,system() can block until the
command is finished,then you execute the second command.otherwise if your
command is working in backend like httpd,to control its runtime is
hard.you may need to get its process id,and always monitor this id,until
the process id is not alive,you execute the follow commands.





  

Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: How to convert month in name in to digit number

2007-11-07 Thread useperl-jeff

--- sivasakthi <[EMAIL PROTECTED]> wrote:

> Hi All,
> 
> How to convert month in name in to digit number, for example the month
> is Apr then converted in to 04.. how to do that??
> 
> 

The easy way is to use a hash,

%mon = ('Jan' => '01',
 'Feb' => '02',
  ...
);

then in the code you can get the digit number by month name.



  
National Bingo Night. Play along for the chance to win $10,000 every week. 
Download your gamecard now at Yahoo!7 TV. 
http://au.blogs.yahoo.com/national-bingo-night/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/