[30957] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2202 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 09:09:43 2009

Date: Wed, 11 Feb 2009 06:09:09 -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           Wed, 11 Feb 2009     Volume: 11 Number: 2202

Today's topics:
    Re: A good data structure to store INI files. <perl@marc-s.de>
    Re: A good data structure to store INI files. <ben@morrow.me.uk>
    Re: error printing page using LWP::Simple <larry@example.invalid>
    Re: error printing page using LWP::Simple <larry@example.invalid>
    Re: error printing page using LWP::Simple <larry@example.invalid>
    Re: error printing page using LWP::Simple <larry@example.invalid>
    Re: error printing page using LWP::Simple <tadmc@seesig.invalid>
    Re: error printing page using LWP::Simple <tadmc@seesig.invalid>
        new CPAN modules on Wed Feb 11 2009 (Randal Schwartz)
    Re: Renaming file - Permission Denied <szrRE@szromanMO.comVE>
    Re: Renaming file - Permission Denied <a_person@anyolddomain.fake>
    Re: Renaming file - Permission Denied <szrRE@szromanMO.comVE>
    Re: win32 perl compiling problem <sisyphus359@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 11 Feb 2009 09:38:42 +0100
From: Marc Lucksch <perl@marc-s.de>
Subject: Re: A good data structure to store INI files.
Message-Id: <gmu2qc$2cqb$1@ariadne.rz.tu-clausthal.de>

sln@netherlands.com schrieb:
> I am assuming you gave up and committed suicide.
> Node's are your only hope to manage this. Trust me.

No, I went to sleep like I said, sorry I couldn't answer.

> If you are between a rock and a hard place.  I will actually
> do this for you in about 20 minutes. The entire thing, including
> user presentation.

But I had kind of an idea for a solution last night: By using 
Contextual::Return in a FETCH of a tied object, I can do what I want 
with the data. (Well actually it has grown to three tied objects) But it 
works like this:

my $data=new Data::INI; (what I called it for now)
my $ini=new Data::INI;
$ini->{Ship}=$data; #Ambigious, carps about it.
dump $ini->{Ship} #$data;
dump $ini->{Ship}->[0] #$data;
#or:
push @{$ini->{Ship}},$data; #The same as above, no carp;
@{$ini->{Ship}}=($data); #replace all


$ini->{Ship}->{nickname}="li_eilte" #or $data->{nickname}="li_elite";
push @{$ini->{Ship}->{fuse}},
	[qw/intermed_damage_smallship01 0.000000 400/];
print $ini->{Ship}->[0]->{fuse}->[0]->[1] # prints 0.000000
print $ini->{Ship}->{fuse}->[0]->[1] #The same
$ini->{Ship}->{fuse}->[0]->[1]="1.0000" #Set
$ini->{Ship}->{fuse}->[0]="1.0000" #Replace the first fuse.
push @{$ini->{Ship}->{fuse}},
	[qw/intermed_damage_smallship01 0.000000 400/];


while (my ($section,$data)=$ini->each()) {
	
}
foreach my $data(@{$ini}) {
	
}
#Dump it to .ini:
print "$ini" #Very disturbing, but kinda cool.
# [Ship]
# nickname=li_elite
# ....

#This is quite a hack and not really finished, but it shows promise to 
be nice .

#Object-like access will also be implemented, for those confuse by that 
one above:
$ini->section("Ship",0)->key("nickname",0,0);
$ini->get("Ship",0)->get("nickname",0)->[0];
foreach

> I will do it for fun, until I get employment.

No need to, but thanks a lot for the offer.

Coding this is the fun in it.

Marc "Maluku" Lucksch


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

Date: Wed, 11 Feb 2009 14:00:58 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: A good data structure to store INI files.
Message-Id: <q92b66-7m1.ln1@osiris.mauzo.dyndns.org>


Quoth Marc Lucksch <perl@marc-s.de>:
> 
> But I had kind of an idea for a solution last night: By using 
> Contextual::Return in a FETCH of a tied object, I can do what I want 
> with the data. (Well actually it has grown to three tied objects) But it 
> works like this:

You may want to look into objects with @{} and %{} overloading, rather
than trying to make tie do something it doesn't want to. Having a tied
variable with context-dependant return values is likely to be very
confusing.

It seems like you want $ini->{Ship} to return something that can pretend
to be either a single value or an array of values. This is what @{}
overloading is for. Of course, the @{} overload will itself probably
need to return a tied array, but that's simple enough.

Ben



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

Date: Tue, 10 Feb 2009 22:57:06 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: error printing page using LWP::Simple
Message-Id: <1a5ht3vuyxr64.18hzo9qrwsku8.dlg@40tude.net>

On Tue, 10 Feb 2009 06:46:06 -0600, Tad J McClellan wrote:

> Larry Gates <larry@example.invalid> wrote:
>> On Sun, 8 Feb 2009 09:08:29 -0600, Tad J McClellan wrote:
>>
>>> Have you seen the Posting Guidelines that are posted here frequently?
>>
>> I read them *all the time.*  
> 
> 
> Very good. Thank you.
> 
> Sorry for implying that you weren't.

No harm, no foul.

I was actually thinking that you were going to say nasty things to me and
intended to respond that it is a large news universe.  The ethics of fixed
noise finds most media, but not this one.  We don't make shit up and
attribute falsely.

I try to read threads on which I'm OP as closely as the respondents could
reasonably expect.  Sometimes I miss a post, like that one a couple weeks
back that talked about how to specify the space correctly when you're
splitting on it.

I tiled a bathroom today: straight, square, and ready for inspection, to
say nothing of the perfect spacing, which requires one more dimension--it
has to plane locally.  When my mind wanders, I think of the content that
I've read in usenet.  My union buddies made fun of me because I would write
the syntax on the walls, which you can do when you hang 40 boards a day and
possess a pencil.

I was fire-rocking on 9/11.  Bush used no carpenters for his "issues."
Anyways, in perl, we're allowed to not know a lot of things for the first
couple years.  It wouldn't be unlike a carpenter's apprenticeship. 
-- 
larry gates

In general, if you think something isn't in Perl, try it out, because it
usually is.  :-)
             -- Larry Wall in <1991Jul31.174523.9447@netlabs.com>


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

Date: Tue, 10 Feb 2009 23:09:24 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: error printing page using LWP::Simple
Message-Id: <1r7emygbsg1u7.1bp9nj4p2xi1u.dlg@40tude.net>

On Tue, 10 Feb 2009 06:46:06 -0600, Tad J McClellan wrote:

> You already have most of the items from the 
> 
>     "Perl problem resolution checklist"
> 
>     http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/c255eff3c2a0bf1a?q=#ba1397e88a4c5a57
> 
> but I'll point to it here in case it might help in the future.

I don't know how to search a usenet group.  I've tried; my 62,873 results
are unfocussed and unsorted.

My point is different regarding the faq's.  I read them as they come up and
interest, to wit, the one on the julian day.  Also the one on Larry Wall's
sigs.  I've got 61 k of Our Implementor's quips as randomquotes, and
they're funny and educational.  

With the faq's, you digest them like your morning bran; you don't call the
faq's for a pizza.
-- 
larry gates

Then people who believe only in Interfaces can use the same
underlying system-defined Roles without compromising their
Java-bedeviled value system.  :-)
             -- Larry Wall in <20040217163036.GA30527@wall.org>


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

Date: Tue, 10 Feb 2009 23:11:19 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: error printing page using LWP::Simple
Message-Id: <qerfqvlrzaar$.1pvj7v20bk50t$.dlg@40tude.net>

On Fri, 06 Feb 2009 13:23:21 -0800, Tim Greer wrote:

> You can grab the Julian date with something like:
> 
> my $juldate = ($t =~ m/name="jd" value="([^"]+)"/) ? $1 : "No date";
> 
> Of course, there are dozens of ways of doing this.

Is that the conditional operator from c there? :
-- 
larry gates

Yes, we have consensus that we need 64 bit support.  :-)
             -- Larry Wall in <199710291922.LAA07101@wall.org>


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

Date: Tue, 10 Feb 2009 23:21:05 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: error printing page using LWP::Simple
Message-Id: <1xwesdl0ohsup$.18x0ovf8gs5u5$.dlg@40tude.net>

On Fri, 6 Feb 2009 15:40:49 -0600, Tad J McClellan wrote:

> Larry Gates <larry@example.invalid> wrote:
> 
> 
>><input type="text" name="jd" value="2454869.37545" size="20" 
>>
>> How do I grab the julian date from this?
> 
> 
> You use a module that understands HTML for processing HTML data.
> 
> 
> ---------------------------
> #!/usr/bin/perl
> use warnings;
> use strict;
> use HTML::TreeBuilder;
> use LWP::Simple;
> 
> my $site_url = 'http://www.fourmilab.ch/cgi-bin/Yoursky';
> my $url_args = 'z=1&lat=35.0836&ns=North&lon=106.651&ew=West';
> my $t = get "$site_url?$url_args" || "Problem";
> 
> my $tree = HTML::TreeBuilder->new_from_content($t);
> 
> foreach my $elem ( $tree->find_by_attribute('name', 'jd') ) {
>     print $elem->attr('value'), "\n";
> }
> ---------------------------

I've had problems getting modules to where they need to be with
activestate.  I tried with DateTime and Time::Julian.

I'll go for TreeBuilder when I need don't need to leave imeediately.
-- 
larry gates

Portability should be the default.
             -- Larry Wall in <199711072201.OAA01123@wall.org>


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

Date: Wed, 11 Feb 2009 07:01:30 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: error printing page using LWP::Simple
Message-Id: <slrngp5j1a.ks9.tadmc@tadmc30.sbcglobal.net>

Larry Gates <larry@example.invalid> wrote:
> On Fri, 06 Feb 2009 13:23:21 -0800, Tim Greer wrote:
>
>> You can grab the Julian date with something like:
>> 
>> my $juldate = ($t =~ m/name="jd" value="([^"]+)"/) ? $1 : "No date";
>> 
>> Of course, there are dozens of ways of doing this.
>
> Is that the conditional operator from c there? :
              ^^^^^^^^^^^^^^^^^^^^


I wonder if maybe there is a heading of "Conditional Operator" in

    perldoc perlop

:-)


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


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

Date: Wed, 11 Feb 2009 06:58:09 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: error printing page using LWP::Simple
Message-Id: <slrngp5ir1.ks9.tadmc@tadmc30.sbcglobal.net>

Larry Gates <larry@example.invalid> wrote:

> I don't know how to search a usenet group.


    http://groups.google.com/advanced_search


(But you probably already knew that, as it is cited in the guidelines.)

Gak!

The URL has changed. Time for an update to the Posting Guidelines...


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


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

Date: Wed, 11 Feb 2009 05:42:25 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Feb 11 2009
Message-Id: <KEvzup.254C@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-Icelandic-0.01
http://search.cpan.org/~hinrik/Acme-CPANAuthors-Icelandic-0.01/
We are Icelandic CPAN authors 
----
Acme-CPANAuthors-Russian-0.3
http://search.cpan.org/~sharifuln/Acme-CPANAuthors-Russian-0.3/
We are Russian CPAN authors 
----
Acme-CPANAuthors-Russian-0.4
http://search.cpan.org/~sharifuln/Acme-CPANAuthors-Russian-0.4/
We are Russian CPAN authors 
----
Acme-CPANAuthors-Russian-0.5
http://search.cpan.org/~sharifuln/Acme-CPANAuthors-Russian-0.5/
We are Russian CPAN authors 
----
Acme-CPANAuthors-Russian-0.6
http://search.cpan.org/~sharifuln/Acme-CPANAuthors-Russian-0.6/
We are Russian CPAN authors 
----
Acme-CPANAuthors-Russian-0.7
http://search.cpan.org/~sharifuln/Acme-CPANAuthors-Russian-0.7/
We are Russian CPAN authors 
----
Algorithm-Evolutionary-0.64
http://search.cpan.org/~jmerelo/Algorithm-Evolutionary-0.64/
Perl module for performing paradigm-free evolutionary algorithms. 
----
Apache2-ASP-2.25
http://search.cpan.org/~johnd/Apache2-ASP-2.25/
ASP for Perl, reloaded. 
----
Apache2-ASP-2.26
http://search.cpan.org/~johnd/Apache2-ASP-2.26/
ASP for Perl, reloaded. 
----
Apache2-ASP-2.27
http://search.cpan.org/~johnd/Apache2-ASP-2.27/
ASP for Perl, reloaded. 
----
App-SVN-Bisect-0.7
http://search.cpan.org/~infinoid/App-SVN-Bisect-0.7/
binary search through svn revisions 
----
CGI-IDS-1.0110
http://search.cpan.org/~hinnerk/CGI-IDS-1.0110/
PerlIDS - Perl Website Intrusion Detection System (XSS, CSRF, SQLI, LFI etc.) 
----
CPANPLUS-YACSmoke-0.31_01
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.31_01/
Yet Another CPANPLUS Smoke Tester 
----
Catalyst-Model-DBIC-Schema-QueryLog-0.08
http://search.cpan.org/~fayland/Catalyst-Model-DBIC-Schema-QueryLog-0.08/
DBIx::Class::QueryLog Model Class 
----
Catalyst-Model-DBIC-Schema-QueryLog-0.09
http://search.cpan.org/~fayland/Catalyst-Model-DBIC-Schema-QueryLog-0.09/
DBIx::Class::QueryLog Model Class 
----
Catalyst-Plugin-Cache-0.08
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Cache-0.08/
Flexible caching support for Catalyst. 
----
Catalyst-Plugin-MobileAgent-0.041
http://search.cpan.org/~kurihara/Catalyst-Plugin-MobileAgent-0.041/
HTTP mobile user agent string parser plugin for Catalyst 
----
Class-DBI-ClassGenerator-1.02
http://search.cpan.org/~dcantrell/Class-DBI-ClassGenerator-1.02/
generate Class::DBI sub-class modules from a pre-exsting database's structure. 
----
Data-DPath-0.04
http://search.cpan.org/~schwigon/Data-DPath-0.04/
DPath is not XPath! 
----
Data-DPath-0.05
http://search.cpan.org/~schwigon/Data-DPath-0.05/
DPath is not XPath! 
----
Data-OpenStruct-Deep-0.01
http://search.cpan.org/~masaki/Data-OpenStruct-Deep-0.01/
allows you to create data objects and set arbitrary attributes deeply 
----
Devel-MRO-0.02
http://search.cpan.org/~gfuji/Devel-MRO-0.02/
Provides mro functions for XS modules 
----
Devel-MRO-0.03
http://search.cpan.org/~gfuji/Devel-MRO-0.03/
Provides mro functions for XS modules 
----
Dotiac-addon-html_template-0.3
http://search.cpan.org/~maluku/Dotiac-addon-html_template-0.3/
----
DustyDB-0.06
http://search.cpan.org/~hanenkamp/DustyDB-0.06/
yet another Moose-based object database 
----
Env-Sanctify-0.04
http://search.cpan.org/~bingos/Env-Sanctify-0.04/
Lexically scoped sanctification of %ENV 
----
FLUTF-1.001
http://search.cpan.org/~maluku/FLUTF-1.001/
----
File-Find-Object-0.1.9
http://search.cpan.org/~shlomif/File-Find-Object-0.1.9/
An object oriented File::Find replacement 
----
Foorum-1.000004
http://search.cpan.org/~fayland/Foorum-1.000004/
forum system based on Catalyst 
----
FreezeThaw-0.45
http://search.cpan.org/~ilyaz/FreezeThaw-0.45/
converting Perl structures to strings and back. 
----
HTML-Packer-0.2
http://search.cpan.org/~nevesenin/HTML-Packer-0.2/
Another CSS minifier 
----
HTTP-Engine-0.1.2
http://search.cpan.org/~yappo/HTTP-Engine-0.1.2/
Web Server Gateway Interface and HTTP Server Engine Drivers (Yet Another Catalyst::Engine) 
----
HTTP-Engine-Middleware-0.01
http://search.cpan.org/~yappo/HTTP-Engine-Middleware-0.01/
middlewares distribution 
----
HTTP-OAI-3.21
http://search.cpan.org/~timbrody/HTTP-OAI-3.21/
API for the OAI-PMH 
----
IO-CaptureOutput-1.11
http://search.cpan.org/~dagolden/IO-CaptureOutput-1.11/
capture STDOUT and STDERR from Perl code, subprocesses or XS 
----
Lingua-EN-Alphabet-Deseret-0.01
http://search.cpan.org/~marnanel/Lingua-EN-Alphabet-Deseret-0.01/
transliterate the Latin to Deseret alphabets 
----
Mail-Outlook-0.15
http://search.cpan.org/~barbie/Mail-Outlook-0.15/
mail module to interface with Microsoft (R) Outlook (R). 
----
Moxy-0.50
http://search.cpan.org/~tokuhirom/Moxy-0.50/
Mobile web development proxy 
----
Mpp
http://search.cpan.org/~pfeiffer/Mpp/
Common subs for makepp and makeppreplay 
----
Muldis-Rosetta-0.13.2
http://search.cpan.org/~duncand/Muldis-Rosetta-0.13.2/
Full-featured truly relational DBMS in Perl 
----
Number-Format-1.63
http://search.cpan.org/~wrw/Number-Format-1.63/
Perl extension for formatting numbers 
----
PICA-Record-0.43
http://search.cpan.org/~voj/PICA-Record-0.43/
Perl extension for handling PICA+ records 
----
POE-Component-Algorithm-Evolutionary-0.0.4.1
http://search.cpan.org/~jmerelo/POE-Component-Algorithm-Evolutionary-0.0.4.1/
Run evolutionary algorithms in a preemptive multitasking way. 
----
POE-Component-SmokeBox-0.16
http://search.cpan.org/~bingos/POE-Component-SmokeBox-0.16/
POE enabled CPAN smoke testing with added value. 
----
Padre-0.27
http://search.cpan.org/~szabgab/Padre-0.27/
Perl Application Development and Refactoring Environment 
----
Path-Dispatcher-0.09
http://search.cpan.org/~sartak/Path-Dispatcher-0.09/
flexible dispatch 
----
RT-Extension-SearchResults-XLS-0.05
http://search.cpan.org/~elacour/RT-Extension-SearchResults-XLS-0.05/
Add Excel format export to RT search results 
----
Rose-HTMLx-Form-Related-0.15
http://search.cpan.org/~karman/Rose-HTMLx-Form-Related-0.15/
RHTMLO forms, living together 
----
SVN-Class-0.13_02
http://search.cpan.org/~karman/SVN-Class-0.13_02/
manipulate Subversion workspaces with Perl objects 
----
Set-Relation-0.6.0
http://search.cpan.org/~duncand/Set-Relation-0.6.0/
Relation data type for Perl 
----
Simo-0.07_02
http://search.cpan.org/~kimoto/Simo-0.07_02/
Very simple framework for Object Oriented Perl. 
----
Sys-Statistics-Linux-0.46
http://search.cpan.org/~bloonix/Sys-Statistics-Linux-0.46/
Front-end module to collect system statistics 
----
Sys-Statistics-Linux-0.47
http://search.cpan.org/~bloonix/Sys-Statistics-Linux-0.47/
Front-end module to collect system statistics 
----
Test-Grian-Data-Dumper-0.01
http://search.cpan.org/~grian/Test-Grian-Data-Dumper-0.01/
Perl extension for blah blah blah 
----
Unix-Uptime-0.32
http://search.cpan.org/~pioto/Unix-Uptime-0.32/
Determine the current uptime, in seconds, across different *NIX architectures 
----
Xacobeo-0.06_03
http://search.cpan.org/~potyl/Xacobeo-0.06_03/
XPath (XML Path Language) visualizer. 
----
xcruciate-008
http://search.cpan.org/~melonman/xcruciate-008/


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: Tue, 10 Feb 2009 22:42:09 -0800
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Renaming file - Permission Denied
Message-Id: <gmts0202neb@news2.newsguy.com>

Ben Morrow wrote:
> Quoth "Bigus" <a_person@anyolddomain.fake>:
>> "Ben Morrow" <ben@morrow.me.uk> wrote in message
>> news:2mf966-lu1.ln1@osiris.mauzo.dyndns.org...
>>
>> > You cannot
>> > rename a file while it's open on Win32, so you will need to get the
>> > Font::TTF::Font object to close the file before you do the rename.
>> > There is also sometimes an issue with virus scanners: if the
>> > scanner is set to scan-on-close, you can get the scanner
>> > re-opening the file immediately so you still can't rename it. If
>> > you can't kill your virus scanner try adding a sleep of a few
>> > seconds before the rename.
>>
>> Nice idea. I had a look at the docs again for Font::TTF::Font and
>> can't find a close function but there is a "release" one which:
>>
>> [quote]
>> Releases ALL of the memory used by the TTF font and all of its
>> component objects. After calling this method, do NOT expect to have
>> anything left in the Font::TTF::Font object
>> [/quote]
>>
>> So the bit of the code that gets the postscript name is now:
>>
>> my $f = Font::TTF::Font->open($fontdir.$font);
>> my $t = $f->{name}->read;
>> my $psname = $t->{strings}[6][1][0]{0};
>> $f->release();
>>
>> It doesn't work though. I also disabled my virus scanner and put a
>> sleep of a couple of seconds just before the rename for good measure
>> but it's still failing to rename the font file :-(
>
> Looking through the source (yuck, that's a fairly unpleasant module),
> it appears that ->release doesn't actually close the file. It look
> like allowing the object to go out of scope should do that, so you
> want something like
>
>    my $psname;
>    {
>        my $f = Font::TTF::Font->open($fontdir.$font);
>        my $t = $f->{name}->read;
>        $psname = $t->{strings}[6][1][0]{0};
>        $f->release;
>    }
>    rename ...;

One additional way would be to set the object to undef, which forces it 
to destruct itself right then and there.

   my $psname;
   my $f = Font::TTF::Font->open($fontdir.$font);
   my $t = $f->{name}->read;
   $psname = $t->{strings}[6][1][0]{0};
   $f->release;
   $f = undef;

   rename ...;

Although it I would agree the separate scope method seems more readable.

-- 
szr 




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

Date: Wed, 11 Feb 2009 08:06:19 -0000
From: "Bigus" <a_person@anyolddomain.fake>
Subject: Re: Renaming file - Permission Denied
Message-Id: <499286ff$0$25591$8d2e0cab@news.newsgroup-binaries.com>

"Ben Morrow" <ben@morrow.me.uk> wrote in message 
news:hiq966-f54.ln1@osiris.mauzo.dyndns.org...

>    my $psname;
>    {
>        my $f = Font::TTF::Font->open($fontdir.$font);
>        my $t = $f->{name}->read;
>        $psname = $t->{strings}[6][1][0]{0};
>        $f->release;
>    }
>    rename ...;

That works :-)

I also tried szr's suggestion of:

my $f = Font::TTF::Font->open($fontdir.$font);
my $t = $f->{name}->read;
my $psname = $t->{strings}[6][1][0]{0};
$f->release;
$f = undef;

but that didn't work. However, this did:

my $f = Font::TTF::Font->open($fontdir.$font);
my $t = $f->{name}->read;
my $psname = $t->{strings}[6][1][0]{0};
$f->release;
$t = undef;

So consequently I tried:

my $f = Font::TTF::Font->open($fontdir.$font);
my $t = $f->{name}->read;
my $psname = $t->{strings}[6][1][0]{0};
$t->release;

which also worked! Bit strange as the Font::TTF::Font clearly shows the 
release() being applied to the open() handle.

Anyway, thank you very much for the help :-)

Bigus 


-----------------
www.Newsgroup-Binaries.com - *Completion*Retention*Speed*
Access your favorite newsgroups from home or on the road
-----------------


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

Date: Wed, 11 Feb 2009 00:43:44 -0800
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Renaming file - Permission Denied
Message-Id: <gmu34102vk3@news2.newsguy.com>

Bigus wrote:
> "Ben Morrow" <ben@morrow.me.uk> wrote in message
> news:hiq966-f54.ln1@osiris.mauzo.dyndns.org...
>
>>    my $psname;
>>    {
>>        my $f = Font::TTF::Font->open($fontdir.$font);
>>        my $t = $f->{name}->read;
>>        $psname = $t->{strings}[6][1][0]{0};
>>        $f->release;
>>    }
>>    rename ...;
>
> That works :-)
>
> I also tried szr's suggestion of:
>
> my $f = Font::TTF::Font->open($fontdir.$font);
> my $t = $f->{name}->read;
> my $psname = $t->{strings}[6][1][0]{0};
> $f->release;
> $f = undef;
>
> but that didn't work. However, this did:
>
> my $f = Font::TTF::Font->open($fontdir.$font);
> my $t = $f->{name}->read;
> my $psname = $t->{strings}[6][1][0]{0};
> $f->release;
> $t = undef;
>
> So consequently I tried:
>
> my $f = Font::TTF::Font->open($fontdir.$font);
> my $t = $f->{name}->read;
> my $psname = $t->{strings}[6][1][0]{0};
> $t->release;
>
> which also worked! Bit strange as the Font::TTF::Font clearly shows
> the release() being applied to the open() handle.
>
> Anyway, thank you very much for the help :-)

Ah, it would seem the file handle is associated with $t, not $f then. 
Too bad it's documentation wasn't more clear about this.

-- 
szr 




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

Date: Tue, 10 Feb 2009 22:21:06 -0800 (PST)
From: sisyphus <sisyphus359@gmail.com>
Subject: Re: win32 perl compiling problem
Message-Id: <e36291e2-37ea-4275-9acd-aaa0ad86fc76@w1g2000prm.googlegroups.com>

On Feb 11, 2:42=A0am, "Thomas Steinbach" <steinb...@gmx-topmail.de>
wrote:

> The binutils version 2.17.50-20060824-1 are (today 2009-02-10)
> definitely the _last_ version of binutils which are able to
> successfull compile perl 5.8.x and 5.10.x (still have problems with
> 5.6.x, but that is not so important.)

Thanks for confirming that it's the binutils version that makes the
difference. Looks like I had better be a little cautious when it comes
to updating binutils :-)

I've built 5.6.0, 5.6.1 and 5.6.2 with MinGW in the past and
experienced no difficulty - but that was a while ago, and not on this
Vista box. I don't see any need to be using 5.6.x on Windows (or
anywhere else for that matter).

I could never get 5.8.0 to build, but from 5.8.3 onwards, I've had no
trouble (except briefly with that binutils isue) on both XP and Vista.

Cheers,
Rob


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

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 2202
***************************************


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