[24929] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7179 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 26 14:06:53 2004

Date: Sun, 26 Sep 2004 11:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 26 Sep 2004     Volume: 10 Number: 7179

Today's topics:
        Arrays : When does the memory get used ? <matrix_calling@yahoo.dot.com>
    Re: Arrays : When does the memory get used ? <nobull@mail.com>
    Re: Counting most frequently-occurring n-grams in a fil <_>
    Re: DBI::ODBC Remote Login to Server <ackcomm@comcast.net>
        how to separate all but www addresses? <piou@gaztea.pl>
    Re: how to separate all but www addresses? <sholden@flexal.cs.usyd.edu.au>
    Re: how to separate all but www addresses? <piou@gaztea.pl>
    Re: how to separate all but www addresses? <mritty@gmail.com>
    Re: how to separate all but www addresses? <piou@gaztea.pl>
    Re: how to separate all but www addresses? <matrix_calling@yahoo.dot.com>
    Re: how to separate all but www addresses? <jurgenex@hotmail.com>
    Re: how to separate all but www addresses? <tadmc@augustmail.com>
    Re: how to separate all but www addresses? <piou@gaztea.pl>
    Re: path delimiter in windows platform("/" could change <wcitoan@NOSPAM-yahoo.com>
    Re: path delimiter in windows platform("/" could change <tadmc@augustmail.com>
    Re: path delimiter in windows platform("/" could change (Peter Scott)
    Re: path delimiter in windows platform("/" could change <tadmc@augustmail.com>
    Re: path delimiter in windows platform("/" could change <1usa@llenroc.ude.invalid>
    Re: path delimiter in windows platform("/" could change <1usa@llenroc.ude.invalid>
    Re: path delimiter in windows platform("/" could change <1usa@llenroc.ude.invalid>
    Re: path delimiter in windows platform("/" could change <wcitoan@NOSPAM-yahoo.com>
    Re: path delimiter in windows platform("/" could change <wcitoan@NOSPAM-yahoo.com>
        Perl-5.8-win32-bin-0.8.exe installation fails (Unknown Poster)
    Re: XML::Twig <pam4prezNOSPAM@hotmail.com>
    Re: XML::Twig <pam4prezNOSPAM@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 26 Sep 2004 20:03:44 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Arrays : When does the memory get used ?
Message-Id: <SBA5d.2$X35.51@news.oracle.com>

Hi,

Considering  the following :

use strict;
use warnings;

my @array = (100,200);
$array[50000] = 300;

How much space is actually used by the array? Is it only for 3 values 
($array[0], [1], [50000]), or for *all* the intervening indices also ?

if(defined $array[2000])

returns false. Does this mean that the space is, in fact, not allocated 
unless explicitly used?

man perldata yields no answer...any where else where I can look ?

Regards
Abhinav


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

Date: Sun, 26 Sep 2004 16:49:11 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Arrays : When does the memory get used ?
Message-Id: <cj6odo$ihg$1@slavica.ukpost.com>

Abhinav wrote:
> my @array = (100,200);
> $array[50000] = 300;
> 
> How much space is actually used by the array? Is it only for 3 values 
> ($array[0], [1], [50000]), or for *all* the intervening indices also ?
> 
> if(defined $array[2000])
> 
> returns false. Does this mean that the space is, in fact, not allocated 
> unless explicitly used?

Some space is allocated - the part that corresponds to the array itself 
(simply an array of pointers).  But the elements of the array are 
scalars and these are not allocated yet.

However defined() can still report false for an element that has been 
allcated - to see if storage is allocated use exists().

> man perldata yields no answer...any where else where I can look ?

perlguts and the sources.



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

Date: Sun, 26 Sep 2004 23:17:17 +1000
From: "C3" <_>
Subject: Re: Counting most frequently-occurring n-grams in a file (or over multiple files)
Message-Id: <4156c15a$0$20124$afc38c87@news.optusnet.com.au>

I'm running Perl 5.6.1 under Debian 3.0. I don't get any output, and have to 
kill the app. Incidentally, what would it take to modify the program so that 
it printed the ASCII code in hex (or decimal)? After all, it will be run on 
binary files.


cheers,

"Larry Felton Johnson" <larryj@gsu.edu> wrote in message 
news:4ae7bf57.0409241054.2e2d081@posting.google.com...
> "C3" <_> wrote in message 
> news:<41542a17$0$23897$afc38c87@news.optusnet.com.au>...
>> Hmm, seems to run on the command-line, but it produces no output for me.
>
> What sort of environment are you running it in?  I cut and pasted his
> oneliner and ran it against a number of files on my workstation, and it
> worked right away.  I haven't really checked the output carefully, but
> on trivial files of character sequences it seems to work as I'd expect.
>
> Larry 




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

Date: Sun, 26 Sep 2004 06:44:12 -0500
From: Fred Goldberg <ackcomm@comcast.net>
Subject: Re: DBI::ODBC Remote Login to Server
Message-Id: <Xns95704EB29E018fredackcommcom@216.196.97.142>

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in
news:uep5d.36906$pA.2434554@news20.bellglobal.com: 

> 
> "Fred Goldberg" <ackcomm@comcast.net> wrote in message 
> news:Xns956EB355A5514fredackcommcom@216.196.97.142...
>> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in
>> news:63L4d.27574$pA.1749387@news20.bellglobal.com:
>>
>>>
>>> "Fred Goldberg" <ackcomm@JUNKcomcast.net> wrote in message
>>> news:Xns956DD566777E8fredackcommcom@216.196.97.142...
>>>> Novice - So no flames please.
>>>>
>>>> I have perl script that connects to our Win2000 Server which is
>>>> running MS SQL Server. My data base handle statement is:
>>>>
>>>> my $dbh = DBI->connect('DBI:ODBC:DB_Name', 'DB_Login', 'DB_PWD') or
>>>> die "Couldn't connect to database: " . DBI->errstr;
>>>>
>>>> The above works fine in the office from my networked PC. I would
>>>> like to be able to run this program from home via the Internet. I
>>>> know my server's IP address, user_login and user_password.
>>>> 1) How can I modify my $dbh to accomodate this?
>>>> 2) Do I need to configure "Data Sources (ODBC)" under my login on
>>>> the remote server so it points to "DB_Name"?
>>>>
>>>
>>> You need to configure a similarly named ODBC source on your home
>>> computer pointing to the IP of the server with the db. You shouldn't
>>> need to change the connection string at all.
>>>
>> Thanks for the reply. I tried to configure this server but it
>> continually fails test. With this IP address, I can log into the
>> server using Remote Desktop. I tried configuring ODBC using 3
>> different logins including Administrator. All failed. I also noted
>> that the ODBC configurator does not
>> send anything out to the net unless I preceed the IP address with a
>> "//" which I do not use in the office.
>>
>> So, what is going on here. Is it possible to configue ODBC for a
>> server that exists remotely on the Internet as an IP address rather
>> than being part of a LAN?
>>
> 
> I think you need to take this question to a group that deals with MS
> SQL and/or ODBC at this point. I can only tell you (having connected
> to MS SQL servers at work from home) that you shouldn't need to take
> any extra steps when setting up the ODBC source. You might want to
> check with your database administrator and see if he/she has set up IP
> blocking on the port to prevent anyone from connecting to the SQL
> server from outside your office's computers. But that's just a stab in
> the dark as to the source of the problem...
> 
> Matt 
> 
> 
> 
Thanks Matt.

I know the firewall is not blocking this IP address. Otherwise, I 
wouldn't be able to access the server using this IP address and Remote 
Desktop. So, I'll try to look elsewhere for the solution. Again, thanks 
for all your assistance.

Fred



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

Date: Sun, 26 Sep 2004 12:41:25 +0200
From: Piotr <piou@gaztea.pl>
Subject: how to separate all but www addresses?
Message-Id: <1fpqaffb8cphp$.vtjbcheaamwz$.dlg@40tude.net>

I need to separate all merged words in my text instead of www and e-mail
addresses. How can I do it?

preg_replace("/(\.)([[:alpha:]])/", "\\1 \\2", "www.google.com
any,merged.words mymail@yahoo.com")

result:
www. google. pl any, merged. words  mymail@yahoo. com :(((

any, merged. words  - this part of text is good but www. google. pl and
mymail@yahoo. com not. How to eliminate splitting of www and e-mail
addresses?


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

Date: 26 Sep 2004 10:45:51 GMT
From: Sam Holden <sholden@flexal.cs.usyd.edu.au>
Subject: Re: how to separate all but www addresses?
Message-Id: <slrncld7ev.cfm.sholden@flexal.cs.usyd.edu.au>

On Sun, 26 Sep 2004 12:41:25 +0200, Piotr <piou@gaztea.pl> wrote:
> I need to separate all merged words in my text instead of www and e-mail
> addresses. How can I do it?
>
> preg_replace("/(\.)([[:alpha:]])/", "\\1 \\2", "www.google.com
> any,merged.words mymail@yahoo.com")
>
> result:
> www. google. pl any, merged. words  mymail@yahoo. com :(((
>
> any, merged. words  - this part of text is good but www. google. pl and
> mymail@yahoo. com not. How to eliminate splitting of www and e-mail
> addresses?

Why not ask somewhere that they discuss whatever it is that  has this
"preg_replace" function that perl doesn't?

-- 
Sam Holden


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

Date: Sun, 26 Sep 2004 12:56:58 +0200
From: Piotr <piou@gaztea.pl>
Subject: Re: how to separate all but www addresses?
Message-Id: <1f0j9ba02l9ve.vxlz9qa1rgmm$.dlg@40tude.net>

Dnia 26 Sep 2004 10:45:51 GMT, Sam Holden napisa³(a):

> On Sun, 26 Sep 2004 12:41:25 +0200, Piotr <piou@gaztea.pl> wrote:
>> I need to separate all merged words in my text instead of www and e-mail
>> addresses. How can I do it?
>>
>> preg_replace("/(\.)([[:alpha:]])/", "\\1 \\2", "www.google.com
>> any,merged.words mymail@yahoo.com")
>>
>> result:
>> www. google. pl any, merged. words  mymail@yahoo. com :(((
>>
>> any, merged. words  - this part of text is good but www. google. pl and
>> mymail@yahoo. com not. How to eliminate splitting of www and e-mail
>> addresses?
> 
> Why not ask somewhere that they discuss whatever it is that  has this
> "preg_replace" function that perl doesn't?

Because it's not preg_replace problem indeed. It is regular expression
problem and preg_replace has roots in pearl language :)


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

Date: Sun, 26 Sep 2004 07:30:38 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: how to separate all but www addresses?
Message-Id: <cj699n$fsm$1@misc-cct.server.rpi.edu>

Piotr wrote:
> Dnia 26 Sep 2004 10:45:51 GMT, Sam Holden napisa³(a):
>
>>Why not ask somewhere that they discuss whatever it is that  has this
>>"preg_replace" function that perl doesn't?
> 
> Because it's not preg_replace problem indeed. It is regular expression
> problem and preg_replace has roots in pearl language :)

PHP's regular expressions, while based on Perl, are not identical to 
Perl's regular expressions.

If you want help with an issue in this group, post a minimal but 
complete *Perl* program that demonstrates your problem.

Paul Lalli

P.S.  This language has nothing to do with oysters.


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

Date: Sun, 26 Sep 2004 13:44:02 +0200
From: Piotr <piou@gaztea.pl>
Subject: Re: how to separate all but www addresses?
Message-Id: <vrs8qodfj5yt$.x1xx1cn25rd3.dlg@40tude.net>

Dnia Sun, 26 Sep 2004 07:30:38 -0400, Paul Lalli napisa³(a):

> If you want help with an issue in this group, post a minimal but 
> complete *Perl* program that demonstrates your problem.

ok, let's forget about PHP and preg_replace :)

I have no any code, I have only question:

Is there any regular expression in perl, which can separate by space all
merged  words in text file instead of www and e-mail addresses?

example text:
"www.google.com any,merged.words mymail@yahoo.com"

incorrect result:
www. google. pl any, merged. words  mymail@yahoo. com

correct result:
www.google.pl any, merged. words  mymail@yahoo.com


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

Date: Sun, 26 Sep 2004 18:21:50 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Re: how to separate all but www addresses?
Message-Id: <l6z5d.1$X35.64@news.oracle.com>

Piotr wrote:
> Dnia Sun, 26 Sep 2004 07:30:38 -0400, Paul Lalli napisa³(a):
> 
> 
>>If you want help with an issue in this group, post a minimal but 
>>complete *Perl* program that demonstrates your problem.
> 
> 
> ok, let's forget about PHP and preg_replace :)
> 
> I have no any code, I have only question:
> 
> Is there any regular expression in perl, which can separate by space all
> merged  words in text file instead of www and e-mail addresses?
> 

perldoc -f split

HTH

Abhinav


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

Date: Sun, 26 Sep 2004 14:18:15 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to separate all but www addresses?
Message-Id: <HcA5d.2157$2t5.541@trnddc07>

Piotr wrote:
> Is there any regular expression in perl, which can separate by space
> all merged  words in text file instead of www and e-mail addresses?
>
> example text:
> "www.google.com any,merged.words mymail@yahoo.com"
>
> incorrect result:
> www. google. pl any, merged. words  mymail@yahoo. com
>
> correct result:
> www.google.pl any, merged. words  mymail@yahoo.com

What is your criteria (on a technical level, not your meta-knowledge about 
the Internet) to differentiate between what you call words and www 
addresses?
If foo.bar.eu a list of words or a www address?

jue 




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

Date: Sun, 26 Sep 2004 09:46:33 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to separate all but www addresses?
Message-Id: <slrncldli9.76f.tadmc@magna.augustmail.com>

Piotr <piou@gaztea.pl> wrote:


> ok, let's forget about PHP


That is to be expected in a Perl newsgroup.


> Is there any regular expression in perl, 


I can give a Perl "solution", it is up to you to translate it into
some other language if you want it in some other language.


> which can separate by space all
> merged  words in text file instead of www and e-mail addresses?


The hard part is determining how accurately you can describe
"URL" (not a "www address") and "email addresses".

I'll take rather inept definitions in the code below, you may
need to replace them with more accurate ones.



> example text:
> "www.google.com any,merged.words mymail@yahoo.com"
             ^^^^
             ^^^^
> correct result:
> www.google.pl any, merged. words  mymail@yahoo.com
            ^^^
            ^^^

Huh?



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

$_ = 'www.google.com any,merged.words mymail@yahoo.com';
s/(\S+)/ is_addr($1) ? $1 : separate($1) /ge;
print "$_\n";

sub is_addr {
   my($adr) = @_;
   return 1 if $adr =~ /^www\./;    # legal URLs may not match this...
   return 1 if $adr =~ tr/@// == 1; # legal email adrs may not match this either
   return 0;
}

sub separate {
   my($text) = @_;
   $text =~ s/(\W)/$1 /g;
   return $text;
}
-------------------------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 26 Sep 2004 17:36:07 +0200
From: Piotr <piou@gaztea.pl>
Subject: Re: how to separate all but www addresses?
Message-Id: <d6r7day15e5t$.f3n8z1ucch9d.dlg@40tude.net>

Dnia Sun, 26 Sep 2004 09:46:33 -0500, Tad McClellan napisa³(a):

> 
>> example text:
>> "www.google.com any,merged.words mymail@yahoo.com"
>              ^^^^
>              ^^^^
>> correct result:
>> www.google.pl any, merged. words  mymail@yahoo.com
>             ^^^
>             ^^^

www.google.com of course - sorry for my mistake :)

> $_ = 'www.google.com any,merged.words mymail@yahoo.com';
> s/(\S+)/ is_addr($1) ? $1 : separate($1) /ge;
> print "$_\n";
> 
> sub is_addr {
>    my($adr) = @_;
>    return 1 if $adr =~ /^www\./;    # legal URLs may not match this...
>    return 1 if $adr =~ tr/@// == 1; # legal email adrs may not match this either
>    return 0;
> }
> 
> sub separate {
>    my($text) = @_;
>    $text =~ s/(\W)/$1 /g;
>    return $text;

thanks for your suggestion, im my case all of the strings with www, http
and @ inside - there are addresses. I don't have addresses without http://
or www.  


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

Date: Sun, 26 Sep 2004 14:21:11 -0000
From: "W. Citoan" <wcitoan@NOSPAM-yahoo.com>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <slrncldk2h.i8.wcitoan@wcitoan-via.supernews.com>

On 26 Sep 2004 03:26:48 GMT, A. Sinan Unur wrote:
>  Alont <end@dream.life> wrote in news:41563101.225947687@130.133.1.4:
>  
> > $specified_folder = 'D:\Inetpub\wwwroot';
>  
>  Windows can deal with / just fine. In fact, I would recommend
>  sticking with / rather than \.

Huh?  Do you actually mean Perl on Windows?  Because Windows (at least
XP) cannot deal with / if there are spaces in the path.

  C:\>c:/Program Files/Internet Explorer/iexplore.exe
  'c:/Program' is not recognized as an internal or external command,
  operable program or batch file.

Perl hides you from this, but if you're outputting for external use,
than you have to deal with it.

> > use File::Finder; @files =
> > File::Finder->type('f')->name('*.html')->in($specified_folder);
> > foreach(@files) {print $_, "\n";}
> > 
> > the result:
> > D:\Inetpub\wwwroot/article/layout/2004/csslayout/fourbox_touch.html
> > D:\Inetpub\wwwroot/article/layout/2004/csslayout/onebox.html
> > D:\Inetpub\wwwroot/article/layout/2004/3h2l.html
> > 
> > there are possible to change  the "/" to "\" in windows platform? I
> > mean if there have a syntax switch to do this so I don't have to
> > replace every "/".  If this is a faq please tell me the perl
> > document name, thank you.

There is no syntax switch for this.  However, you can easily do a
substitution prior to your print.  Change the above to:

   foreach(@files) {
      s/\//\\/g;
      print "$_\n";
   }

- W. Citoan
-- 
We give up the fort when there's not a man left to defend.
-- [Captain] George Croghan


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

Date: Sun, 26 Sep 2004 08:46:10 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <slrncldi12.76f.tadmc@magna.augustmail.com>

Alont <end@dream.life> wrote:

> EditPlus also can't,the "common dialog" box can't deal with "/" path


You should report that bug in EditPlus, maybe they will fix it...


Until then:

   tr#/#\\#;  # replace sensible slashes with silly slashes


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 26 Sep 2004 15:03:53 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <tTA5d.114117$%S.21618@pd7tw2no>

In article <41563101.225947687@130.133.1.4>,
 Alont <end@dream.life> writes:
>the result:
>D:\Inetpub\wwwroot/article/layout/2004/csslayout/fourbox_touch.html
>D:\Inetpub\wwwroot/article/layout/2004/csslayout/onebox.html
>D:\Inetpub\wwwroot/article/layout/2004/3h2l.html
>
>there are possible to change  the "/" to "\" in windows platform?

use File::Spec;         # Core module
$file = File::Spec->canonpath($file);

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


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

Date: Sun, 26 Sep 2004 10:27:29 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <slrncldnv1.7at.tadmc@magna.augustmail.com>

W. Citoan <wcitoan@NOSPAM-yahoo.com> wrote:
> On 26 Sep 2004 03:26:48 GMT, A. Sinan Unur wrote:
>>  Alont <end@dream.life> wrote in news:41563101.225947687@130.133.1.4:
>>  
>> > $specified_folder = 'D:\Inetpub\wwwroot';
>>  
>>  Windows can deal with / just fine. In fact, I would recommend
>>  sticking with / rather than \.
> 
> Huh?  Do you actually mean Perl on Windows?  


Yes.

Have you tried using open() on a path that uses forward slashes?

Didn't it work when you tried it?


> Because Windows (at least
> XP) cannot deal with / if there are spaces in the path.
> 
>   C:\>c:/Program Files/Internet Explorer/iexplore.exe
>   'c:/Program' is not recognized as an internal or external command,
>   operable program or batch file.


Windows can deal with / just fine.

What you have shown is that the Windows _command interpreter_
cannot deal with slash (because it is using it for something else).

If the filespec is not destined for the command interpreter, then
forward slashes will work just fine on Windows filesystems.


> Perl hides you from this, but if you're outputting for external use,
                                                     ^^^^^^^^^^^^^^^^
> than you have to deal with it.


If you are outputting for external use *in the command interpreter*.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 26 Sep 2004 16:53:17 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <Xns9570831AE4A38asu1cornelledu@132.236.56.8>

"W. Citoan" <wcitoan@NOSPAM-yahoo.com> wrote in 
news:slrncldk2h.i8.wcitoan@wcitoan-via.supernews.com:

> On 26 Sep 2004 03:26:48 GMT, A. Sinan Unur wrote:
>>  Alont <end@dream.life> wrote in news:41563101.225947687@130.133.1.4:
>>  
>> > $specified_folder = 'D:\Inetpub\wwwroot';
>>  
>>  Windows can deal with / just fine. In fact, I would recommend
>>  sticking with / rather than \.
> 
> Huh?  Do you actually mean Perl on Windows?  Because Windows (at least
> XP) cannot deal with / if there are spaces in the path.
> 
>   C:\>c:/Program Files/Internet Explorer/iexplore.exe
>   'c:/Program' is not recognized as an internal or external command,
>   operable program or batch file.

Huh? Do you realize that in the example you give, it does not matter what 
slash you are using? In the cmd.exe shell, regardless of the slash, you 
need to enclose file paths that include space in double quotation marks. 
On the other hand,

"c:/Program Files/Internet Explorer/iexplore.exe"

works just fine (i.e. runs Internet Explorer).

> Perl hides you from this, but if you're outputting for external use,
> than you have to deal with it.

If the program you are dealing with is deficient in its handling of file 
names and paths. By the way, notepad can deal with these paths just fine:

notepad "c:\www/unur/htdocs/index.html"

works just fine (XPP).

-- 
A. Sinan Unur
1usa@llenroc.ude.invalid 
(remove '.invalid' and reverse each component for email address)



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

Date: 26 Sep 2004 17:02:21 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <Xns957084A3D6E83asu1cornelledu@132.236.56.8>

peter@PSDT.com (Peter Scott) wrote in news:tTA5d.114117$%S.21618
@pd7tw2no:

> In article <41563101.225947687@130.133.1.4>,
>  Alont <end@dream.life> writes:
>>the result:
>>D:\Inetpub\wwwroot/article/layout/2004/csslayout/fourbox_touch.html
>>D:\Inetpub\wwwroot/article/layout/2004/csslayout/onebox.html
>>D:\Inetpub\wwwroot/article/layout/2004/3h2l.html
>>
>>there are possible to change  the "/" to "\" in windows platform?
> 
> use File::Spec;         # Core module
> $file = File::Spec->canonpath($file);
> 

That is good advice. However, 

#! perl

use strict;
use warnings;

use File::Finder;
use File::Spec::Functions qw( catfile );

my $dir  = catfile 'c:', 'www', 'unur', 'htdocs';
my @html = File::Finder->type('f')->name('*.html')->in($dir);

print "$_\n" for (@html);

__END__

This script will output:

C:\www\unur\htdocs/index.html
C:\www\unur\htdocs/comp/anti-spam-howto.html
C:\www\unur\htdocs/comp/c-examples.html
C:\www\unur\htdocs/comp/index.html

so, the OP would still be asking the same question. (Note that I do not 
think the behavior above is a problem, but I _think_ it is caused by 
File::Find::PathCombine using / for both Unix and Win32 platforms).

-- 
A. Sinan Unur
1usa@llenroc.ude.invalid 
(remove '.invalid' and reverse each component for email address)



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

Date: 26 Sep 2004 17:17:47 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <Xns95708741EA0ABasu1cornelledu@132.236.56.8>

Alont <end@dream.life> wrote in news:41584b6e.232712937@130.133.1.4:

> "A. Sinan Unur" <1usa@llenroc.ude.invalid>Wrote at 26 Sep 2004
> 03:26:48 GMT:
>>Windows can deal with / just fine. In fact, I would recommend sticking
>>with / rather than \.
> 
> notepad can't open
> D:/Inetpub/wwwroot/article/layout/2004/csslayout/onebox_absolute.html
> EditPlus also can't,the "common dialog" box can't deal with "/" path

Are you sure? Notepad has no problem with such paths on my Win 98 or Win XP 
systems.

-- 
A. Sinan Unur
1usa@llenroc.ude.invalid 
(remove '.invalid' and reverse each component for email address)



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

Date: Sun, 26 Sep 2004 17:34:23 -0000
From: "W. Citoan" <wcitoan@NOSPAM-yahoo.com>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <slrncldvcm.i8.wcitoan@wcitoan-via.supernews.com>

On 26 Sep 2004 16:53:17 GMT, A. Sinan Unur wrote:
>  
>  Huh? Do you realize that in the example you give, it does not matter
>  what slash you are using? In the cmd.exe shell, regardless of the
>  slash, you need to enclose file paths that include space in double
>  quotation marks.  On the other hand,
>  
>  "c:/Program Files/Internet Explorer/iexplore.exe"
>  
>  works just fine (i.e. runs Internet Explorer).

You are correct.

What gets me is that I actually tried both before I posted and still got
it wrong.  I'm guessing I used the tab autocomplete for the \ example
(which automatically quotes the result) and missed the quotes since I'm
so used to seeing them.

- W. Citoan
-- 
First say to yourself what you would be; and then do what you have to do.
-- Epictetus


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

Date: Sun, 26 Sep 2004 17:42:32 -0000
From: "W. Citoan" <wcitoan@NOSPAM-yahoo.com>
Subject: Re: path delimiter in windows platform("/" could change to "\"?)
Message-Id: <slrncldvs2.i8.wcitoan@wcitoan-via.supernews.com>

On Sun, 26 Sep 2004 10:27:29 -0500, Tad McClellan wrote:
>  
>  Windows can deal with / just fine.
>  
>  What you have shown is that the Windows _command interpreter_ cannot
>  deal with slash (because it is using it for something else).
>  
>  If the filespec is not destined for the command interpreter, then
>  forward slashes will work just fine on Windows filesystems.

Actually, A. Sinan Unur correctly pointed out that the cmd.exe can deal
with / as well.

However, if it didn't, I find it odd to claim it's correct to state
Windows can deal with them one of the pieces of Windows cannot...

- W. Citoan
-- 
First say to yourself what you would be; and then do what you have to do.
-- Epictetus


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

Date: 26 Sep 2004 10:50:06 -0700
From: use63net@yahoo.com (Unknown Poster)
Subject: Perl-5.8-win32-bin-0.8.exe installation fails
Message-Id: <c62e93ec.0409260950.36f2efbe@posting.google.com>

I've tried using the default the install program uses (which is
windows\temp for some strange reason) or creating a new directory for
the top-level.  Either way, when I reach the "Configure" window, the
"Perl directory:" and "Apache2 directory:" textboxes are already
filled in as "..PERL/BIN".  When I click the "Configure" button, this
error box appears:

"Perl configuation failed

!  Please give the top-level Perl directory."


?


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

Date: Sun, 26 Sep 2004 13:08:24 GMT
From: c0rk <pam4prezNOSPAM@hotmail.com>
Subject: Re: XML::Twig
Message-Id: <Xns95705CFD3B566pam4prezNOSPAMhotmai@68.12.19.6>

Brian McCauley <nobull@mail.com> wrote in
news:cj46h1$v2m$1@slavica.ukpost.com: 

> 
> 
> c0rk wrote:
>> OK. I am now desperate. I have written a sub routine to slipt up
>> large (~2-3MB) XML documents into seperate documents. When I use
>> $twig-> parsefile I get the following error:
>> 
>> "not well-formed (invalid token) at line 27072, column 1934, byte
>> 878399 at C:/Perl/site/lib/XML/Parser.pm line 187"
> 
> Well, in the absense of any evidence to the contrary I'm be inclined
> to accept that at face value.
> 
> Do you have a reason to disbelive it?
> 

Brian

You know - I have been working on this script since Thursday, trying to 
determine _my_ problem. When I saw this error, I took it as there was an 
error in my processing method (i.e. memory problem). For whatever reason, I 
just didn't read the error message for what it was. Turns out that the XML 
has bad characters in it. I replaced those characters and my script 
processed a 3MB file in seconds. 

Many thanks for your response!

-c


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

Date: Sun, 26 Sep 2004 13:09:12 GMT
From: c0rk <pam4prezNOSPAM@hotmail.com>
Subject: Re: XML::Twig
Message-Id: <Xns95705D202DC5Apam4prezNOSPAMhotmai@68.12.19.6>

Tad McClellan <tadmc@augustmail.com> wrote in
news:slrnclb93j.qpk.tadmc@magna.augustmail.com: 

> c0rk <pam4prezNOSPAM@hotmail.com> wrote:
> 
>> When I use $twig->
>> parsefile I get the following error:
>> 
>> "not well-formed (invalid token) at line 27072, column 1934, byte
>> 878399 at C:/Perl/site/lib/XML/Parser.pm line 187"
> 
> 
> This message means that there is something wrong with the _data_
> rather than with the code.
> 
> Open the data file to the 1934th character on the 27072nd line
> and see what it is that makes it invalid XML.
> 
> 
> 

Tad,

thanks for the response. you are 100% correct. I replaced the bad 
characters at the specified location, and life is good!!!

Thanks,

-c


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

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 V10 Issue 7179
***************************************


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