[25617] in Perl-Users-Digest
Perl-Users Digest, Issue: 7861 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 5 18:05:44 2005
Date: Sat, 5 Mar 2005 15:05:19 -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 Sat, 5 Mar 2005 Volume: 10 Number: 7861
Today's topics:
[ICCIMA'05] Final Call for Papers; Due Date March 10, 2 <avinash.ramani@gmail.com>
[ICSEng'05] Final CFP - due date March 10, 2005 <avinash.ramani@gmail.com>
another problem with look-around eric.hall@gmail.com
Re: another problem with look-around <nobull@mail.com>
Re: another problem with look-around <mxayahoo@gmail.com>
Re: another problem with look-around <kkeller-usenet@wombat.san-francisco.ca.us>
Re: another problem with look-around <nobull@mail.com>
Re: another problem with look-around eric.hall@gmail.com
Re: Another use vs. require snafu <shawn.corey@sympatico.ca>
Re: cgi question kinda <cwilbur@mithril.chromatico.net>
Re: disagree with a few things in perlsec <abigail@abigail.nl>
Re: dividing strings (Anno Siegel)
file locking : does the os do this ? <jazeker_b_nospamlalala@yahoo.co.uk>
Re: file locking : does the os do this ? <matternc@comcast.net>
Re: Looping through a log file <ajperl@mac.com>
Need to download exact copy of text file...little squar mortgages2005@aol.com
Re: Need to download exact copy of text file...little s <noreply@gunnar.cc>
PerlMagick, Annotate, and Webdings <aaron@daltons.ca>
Re: PerlMagick, Annotate, and Webdings <flavell@ph.gla.ac.uk>
Re: print isn't flashed using PERL by MSWin32 on Window (Anno Siegel)
Re: qx, Filter::Simple, and testing <abigail@abigail.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Mar 2005 14:07:51 -0800
From: "avinash" <avinash.ramani@gmail.com>
Subject: [ICCIMA'05] Final Call for Papers; Due Date March 10, 2005
Message-Id: <1110060471.109573.151870@g14g2000cwa.googlegroups.com>
We apologize if this is a duplicate email.
International Conference on Computational Intelligence and
Multimedia Applications, (ICCIMA) August 16-18, 2005
University of Nevada, Las Vegas, USA
(www.iccima.org)
F I N A L C A L L F O R P A P E R S
The International Conference on Computational Intelligence and
Multimedia Applications will be held at the University of Nevada, Las
Vegas, USA on August 16-18, 2005. The conference will provide an
international forum for discussion on issues in the areas of
Computational Intelligence and Multimedia for scientists, engineers,
researchers and practitioners. ICCIMA'05 is organized jointly with
International Conference on Systems Engineering (ICSEng'05:
www.icseng.info) and the registered participants of ICCIMA'05 will be
able to attend ICSEng'05.
The conference will include sessions on theory, implementation and
applications, as well as the non-technical areas of challenges in
education and technology transfer to industry. There will be both oral
and poster sessions. Accepted full papers will be included in the
proceedings to be published by IEEE CS Press. Selected papers will be
published in "International Journal on Computational Intelligence and
Applications" published by World Scientific Publishing Company Press.
Several well-known keynote speakers will address the conference.
Conference Topics Include (but not limited to):
Artificial Intelligence, Artificial Neural Networks, Pattern
Recognition, Fuzzy Systems, Genetic Algorithms, Hybrid Systems,
Intelligent Control, Intelligent Databases, Knowledge-based
Engineering, Learning Algorithms, Memory: Storage and Retrieval,
Multimedia Systems, Formal Models for Multimedia, Interactive
Multimedia, Multimedia and Virtual Reality, Multimedia and
Telecommunications, Multimedia Information Retrieval, Multimedia and
Security, Multimedia Hardware, Multimedia and Algorithms.
Special Poster Session:
ICCIMA'05 will include a special poster session devoted to recent work
and work-in-progress. Abstracts are solicited for this session (2 page
limit) in camera ready form, and may be submitted up to 30 days before
the conference date. They will not be refereed and will not be included
in the proceedings, but will be distributed to attendees upon arrival.
Students are especially encouraged to submit abstracts for this
session.
Invited Sessions: Keynote speakers (key industrialists, chief research
scientists and leading academics) will be addressing the main issues of
the conference.
Important Dates: Submission of papers received latest on: March 10,
2005
Submission of Papers: Papers in English reporting original and
unpublished research results and experience are solicited. Electronic
submission of papers via www.iccima.org. Visit the web page for more
information.
Page Limits: Papers for refereeing should be double-spaced and must
include an abstract of 100-150 words with up to six keywords. Selected
papers will have a limit of 6 pages in the proceedings to be published
by IEEE.
Evaluation Process: All submissions will be refereed based on the
following criteria by two reviewers with appropriate background:
originality
significance
contribution to the area of research
technical quality
relevance to ICCIMA 2005 topics
clarity of presentation
Contact Information:
ICCIMA' 05 Secretariat
Department of Electrical and Computer Engineering
University of Nevada, Las Vegas
4505 Maryland Parkway, Box 454026
Las Vegas, NV 89154-4026
USA
Phone: +1 702 895 4184
Fax: +1 702 895 1115
email: secretary@iccima.org
URL: http://www.iccima.org/
_______________________________________________
Conf mailing list
Conf@Mail.Egr.UNLV.EDU
http://Mail.Egr.UNLV.EDU/mailman/listinfo/conf
------------------------------
Date: 5 Mar 2005 14:07:11 -0800
From: "avinash" <avinash.ramani@gmail.com>
Subject: [ICSEng'05] Final CFP - due date March 10, 2005
Message-Id: <1110060431.030092.210140@f14g2000cwb.googlegroups.com>
We apologize if this is a duplicate email.
EIGHTEENTH INTERNATIONAL CONFERENCE ON SYSTEMS ENGINEERING (ICSEng05)
LAS VEGAS, USA,
AUGUST 16-18, 2005
(http://www.icseng.info)
This series of International Conferences is jointly organized on a
rotational basis among three institutions, University of Nevada, Las
Vegas, USA, Technical University of Wroclaw, Poland, and Coventry
University, UK. In August 2005, the 18th International Conference will
be held in Las Vegas, NV, at the University of Nevada, Las Vegas, USA.
The Proceedings of the conference will be published by IEEE CS.
ICSEng05 is organized jointly with the International Conference on
Computational Intelligence and Multimedia Applications (ICCIMA'05:
www.iccima.org) and the registered participants of ICSEng05 will be
able to attend ICCIMA05.
Scope of Conference:
The Conference will cover the general area of Systems Engineering, with
particular emphasis being placed on applications. It is expected to
include sessions on the following themes:
Avionics
Computer Algorithms, Databases, Parallel and Distributed Systems,
Networks
Digital systems, Architecture
Control Theory, System Identification and Adaptive Control, Nonlinear
Controls
Engineered Systems for Nuclear Waste Management
Environmental Systems and Energy Systems
Expert Systems and Artificial Intelligence
Finance Engineering
Geographic Information Systems
Global Position Systems
Information Theory and Communication Systems
Neural Network and Applications
Requirements Processes
Risk Management
Robotics and Industrial Automation
Systems Engineering Metrics
Systems Engineering Paradigms, Standards and Challenges
System Architecture
Standards and Testing
Signal Processing
Systems Engineering Education
Transportation Systems
Special Tracks:
1. Data Fusion:
Data fusion is the concept of comparing, combining, and interpreting
data over time and from disparate information sources (sensors, data
bases, and knowledge bases) in order to gain a better understanding of
ones environment, scenario, and/or situation. The four primary level
of data fusion include object refinement, situational assessment,
impact assessment, and refinement. The applications of and
technologies associated with data fusion are quite varied.
Applications include (but are not limited to) target tracking, fault
detection and diagnosis, environmental monitoring, control systems,
medical systems, robotics, and traffic control. Technologies in the
field of data fusion include estimation theory, neural networks, fuzzy
logic, control, probability theory, image processing, decision theory,
and data mining. Papers are being sought for this special session on
data fusion which address advances in fusion technologies and
applications of data fusion systems. One page abstracts for the purpose
of reviewing are due by March 10, 2004.
For more information: http://www.icseng.info/data.htm
2. Risk Management:
This track is ideal for program/project managers, project personnel,
risk managers, and support personnel wanting to develop and expand
knowledge, and share experiences, on best practices in aerospace risk
management processes. Presentations by invited speakers, followed by a
panel discussion, are provided for track participants. Risk management
is a project-wide effort involving management, engineering, production,
test, and support personnel. Several customers, including NASA and the
DoD, continue to observe that risk management is important to project
success and yet lacks rigor in a majority of space activities. This
track on Current Trends and Best Practices in aerospace risk management
is designed to explore risk management contributions to current and
future space programs, including projects from many customer
communities (including commercial, NASA, DoD, and ESA among others).
Key themes include how practices are applied successfully to programs
and organizations, how the risk process influences decision-making and
project cost management, and selection of successful tools for
quantitative cost and schedule risk analysis. Lessons learned from
executing risk management on a wide variety of programs will be
presented to illustrate implementation of success-oriented risk
processes. One page abstracts for the purpose of reviewing are due by
March 10, 2004.
For more information: http://www.icseng.info/strm.htm
3. Computer Infrastructure for Systems Biology:
The special session's goal is to bring forth ideas and collaborations
among industrial and academic bioinformaticians, biocomputing
professionals, data analysts, and system biologists to facilitate
systems biology research and findings. Both research papers (6 pages,
IEEE Proceedings format) and poster papers (2 pages) are solicited to
explore case histories of building and maintaining IT infrastructures
that support advanced biological research. Both industrial and academic
contributions are welcome.
Systems Biology is an emerging field that seeks to analyze disparate
forms of biological data with an aim of uncovering the function and
interaction of the underlying biological systems. It is characterized
by voluminous and heterogeneous data, incomplete data sets, low data
signal/noise ratios, and extreme difficulties in precisely reproducing
experimental conditions. These drawbacks are offset by the profound
interest in the field by the Pharmaceutical and Biotechnology
industries and by the illumination of biological research in general.
We welcome papers/presentations that examine fresh perspectives and
profound experiences in the research and development of computer
systems enabling systems biology. Topics of interests include (but are
not limited to): Microarray Data Analysis, Functional Imaging and
Pattern Recognition, Biological database integration and knowledge
representation, Ontologies and semantic web systems for biology,
Biomedical literature text mining, Micro-surgery and
micro-manipulation, Application of nanotechnology to biological
systems, Protein-protein interactions, Proteomics, Protein-small
molecule interactions, Metabolic and Genetic Pathways, Visualization of
complex data relationships, Biological data tracking and labelling,
Clinical Informatics, Laboratory Information Management Systems,
Measuring cellular metabolism and cellular signalling.
For more information: http://bio.informatics.iupui.edu/bio-05/
Submissions:
We invite you to submit a one page abstract for the purpose of
reviewing by March 10, 2005. Accepted authors will be invited to submit
a full paper (6 pages maximum limit) for presentation. All abstracts
are to be submitted in PDF, postscript or MS word version
electronically. For more information on submissions refer to:
http://www.ee.unlv.edu/~selvaraj/icse05/submission/. Please follow the
ICSEng'05 guidelines for more information on submission. Submission
implies the willingness of at least one of the authors to register and
present the paper. All abstracts will be reviewed by two independent
referees.
Speal Poster Session:
ICSEng'05 will include a special poster session devoted to recent work
and work-in-progress. Abstracts are solicited for this session (2 page
limit) in camera ready form, and may be submitted up to 30 days before
the conference date. They will not be refereed and will not be included
in the proceedings, but will be distributed to attendees upon arrival.
Students are especially encouraged to submit abstracts for this
session.
Important Dates:
Abstracts due: March 10, 2005
Contact:
Conference Secretary, ICSEng-2005
Howard R. Hughes College of Engineering
University of Nevada, Las Vegas, Las Vegas, NV 89154-4005
Phone: (702) 895 4184
FAX: (702) 895 1115
email: secretary@icseng.info
URL: http://www.icseng. info /
_______________________________________________
Conf mailing list
Conf@Mail.Egr.UNLV.EDU
http://Mail.Egr.UNLV.EDU/mailman/listinfo/conf
------------------------------
Date: 5 Mar 2005 11:47:53 -0800
From: eric.hall@gmail.com
Subject: another problem with look-around
Message-Id: <1110052073.746293.186530@g14g2000cwa.googlegroups.com>
Sorry for the newbie questions
I need a one-line regexp that only return a match if the test string
only exists once in the input. For example, find 'abc' if no other
occurrences of 'abc' exist anywhere in the input string of 'abc abc
abc'. This should be simple, but I'm having a lot of trouble with
limiting the scope.
/(?!(abc)).*abc.*/ doesn't work, because that traps the last instance
(which is not followed by anything). /.*abc.*(?<!(abc))/ has the same
problem in reverse. Adding them together for
/(?!(abc)).*abc.*(?<!(abc))/ traps 'bc abc ab' in the middle, which is
not what I want (I need to return a match only if it exists in
isolation).
This gets even harder if the input has lots of other noise in the
input. For example, 'abc def abc def abc'. Suffice it to say that my
input has lots of junk, including non-word characters.
I thought that something like this would be a fairly stock regexp but I
haven't been able to locate anything in google that seems relevant.
Surely this is possible?
Thanks for the help!
------------------------------
Date: Sat, 05 Mar 2005 21:09:04 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: another problem with look-around
Message-Id: <d0d6re$rti$1@sun3.bham.ac.uk>
eric.hall@gmail.com wrote:
> I need a one-line regexp that only return a match if the test string
> only exists once in the input. For example, find 'abc' if no other
> occurrences of 'abc' exist anywhere in the input string of 'abc abc
> abc'. This should be simple, but I'm having a lot of trouble with
> limiting the scope.
Would it be sufficient to look for 'abc' but not if the string contains
abc at least twice?
/abc/ && !/abc.*abc/
Or if you insist on a single regex:
/^(?!abc.*abc).*abc/
------------------------------
Date: 5 Mar 2005 13:22:10 -0800
From: "Michael Abootorab" <mxayahoo@gmail.com>
Subject: Re: another problem with look-around
Message-Id: <1110057730.060368.132980@o13g2000cwo.googlegroups.com>
try this
if [[ "$x" = *abc* ]];then
x=${x%?abc*}
if [[ "$x" != *abc* ]];then
echo its true
fi
fi
thanks
Michael
------------------------------
Date: Sat, 5 Mar 2005 13:38:25 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: another problem with look-around
Message-Id: <mflpf2x8qu.ln2@goaway.wombat.san-francisco.ca.us>
On 2005-03-05, Michael Abootorab <mxayahoo@gmail.com> wrote:
>
> if [[ "$x" = *abc* ]];then
> x=${x%?abc*}
> if [[ "$x" != *abc* ]];then
> echo its true
> fi
> fi
That's neither perl (this is comp.lang.perl.misc!) nor one-line (which
is what the OP asked for). See Brian's post for more appropriate
suggestions. (Obviously, the above could be easily written in Perl, if
the OP relaxes his one-line requirement.)
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information
------------------------------
Date: Sat, 05 Mar 2005 21:36:06 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: another problem with look-around
Message-Id: <d0d8e3$sf0$1@sun3.bham.ac.uk>
Michael Abootorab wrote:
> try this
>
> if [[ "$x" = *abc* ]];then
> x=${x%?abc*}
> if [[ "$x" != *abc* ]];then
> echo its true
> fi
> fi
Er, wrong newsgroup.
------------------------------
Date: 5 Mar 2005 13:52:16 -0800
From: eric.hall@gmail.com
Subject: Re: another problem with look-around
Message-Id: <1110059536.823628.206660@o13g2000cwo.googlegroups.com>
on Sat, 05 Mar 2005 21:09:04 +0000, Brian McCauley <nob...@mail.com>
wrote:
> /^(?!abc.*abc).*abc/
That works in my specific case, so thanks. It doesn't work in the
generalized case, since it requires the leading characters to match.
------------------------------
Date: Sat, 05 Mar 2005 14:34:36 -0500
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: Another use vs. require snafu
Message-Id: <4RnWd.67475$Vf6.1846420@news20.bellglobal.com>
J Krugman wrote:
> I've spent more hours than I care to admit trying to understand
> the difference between Perl's use and require, and I discovered
> today that all this effort has been a miserable waste of time,
> because use and require *still* confound my attempts at coding.
> For example.
>
> I have a method "a" in package A that must invoke a class method
> "b" from a package B, and the identity of package B is not known
> until runtime.
>
> package A;
> #...
> sub a {
> my ($self, $package) = @_;
> # use B;
> eval { "require $package; 1" } or die "Have a cow";
>
> $package->b;
> }
>
> In the form above, perl dies with a message "Can't locate object
> method "b" via package "B" (perhaps you forgot to load "B"?)". If
> I uncomment the "use B;" statement (and comment out the eval line),
> the code runs fine, but of course this solution is not acceptable,
> because I can't hard-code the package name.
>
> I don't understand why perl will load B (via the eval'ed require
> statement) without any errors, and still fail to find method b in
> B. What gives?
>
> TIA!
>
> jill
>
Perl was never designed for dynamic loading of objects. (Was Perl
designed?) If you are creating object B on the fly, you will need
dynamic loading; if not, try loading all the appropriate objects and use
polymorphisms to execute the correct method.
Also see: perldoc AutoSplit
--- Shawn
------------------------------
Date: Sat, 05 Mar 2005 22:39:15 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: cgi question kinda
Message-Id: <87mzth7mbz.fsf@mithril.chromatico.net>
>>>>> "BW" == Brian Wakem <no@email.com> writes:
BW> Shawn Corey wrote:
>> Brian Wakem wrote:
>>> $myvar =~ s!\n$!!;
>>>
>> chomp ($myvar);
>>
>> See perldoc -f chomp
BW> TIMTOWTDI
Yes, but they're not all good. What does your code do when the string
ends in \r\n on a platform where that's the line ending?
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: 05 Mar 2005 22:25:25 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: disagree with a few things in perlsec
Message-Id: <slrnd2kcel.v9v.abigail@alexandra.abigail.nl>
GreenLeaf (newspost@kohombanDELETE.net) wrote on MMMMCCIV September
MCMXCIII in <URL:news:38sl34F5rgpg3U1@individual.net>:
// Abigail wrote:
//
// > But the bank analogue is flawed because nowadays, one of the features
// > of a bank is that the banks takes the responsibility.
//
// It's not entirely flawed in this view. But it works _against_ what OP
// wanted to show. :o) Old fashioned banks are 'low-security' systems, and
// current banks are 'high security' systems. When you are satisfied about
// the level of security the system provides by itself, then you think of
// having convenience instead of sacrificing it for some additional
// 'chance' security.
//
// IMHO, the OP's argument was fundamentally correct - to combat it, you
// need the argument of practical convenience/usability, hence was my
// question. :) Next thing is highly related to the OP's argument:
//
// In _my_ case, I won't only keep my money in bank, but would even make
// some of its properties 'readable' to others. For instance, I give out my
// bank account number to people whom I never trust, so they can transfer
// money online. They don't have to write cheques, I don't have to cash
// them - convenient for everyone. This is possible because I'm happy about
// the security of the bank and don't have to resort to "nobody knows where
// my money is" strategies for a "better" sense of security. And it
// increases the usability of my bank account compared to the "treasure
// island" strategy :o).
Of course, if you have some money you don't want your countries revenue
service to know about, you might want to prevent a remote island over
the bank next door. ;-)
Abigail
--
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
------------------------------
Date: 5 Mar 2005 21:00:00 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dividing strings
Message-Id: <d0d6kg$ld7$2@mamenchi.zrz.TU-Berlin.DE>
A. Sinan Unur <1usa@llenroc.ude.invalid> wrote in comp.lang.perl.misc:
> "LEH" <l.heisler@utoronto.ca> wrote in
> news:ICuEow.CDz@campus-news-reading.utoronto.ca:
>
> > "robin" <robin@infusedlight.net> wrote in message
> > news:1109961386.306024.104060@z14g2000cwz.googlegroups.com...
>
> >> I'm sorry I couldn't post code for this question, but I have no idea
> >> where to start on this one.
> >>
> >> I need code (or suggestions) for the problem of inserting a string
> >> into a variable string every x (number) characters and then parsing
> >> it back into the first original string and then printing the original
> >> string with the inserted strings.
>
> ...
>
> > I would do the following, although there may be a more concise way to
> > do it. Larry
> > -- but not sure what you mean by "parsing it back into the first
> > original string"
[well-founded critique of original question]
> How about this one?
>
> #! /usr/bin/perl
>
> use strict;
> use warnings;
>
> my $insert = 'XXX';
> my $source = 'abcdefghijklmnopqrstuvwxyz';
> my $step = 4;
>
> my $target;
>
> my $cursor = 0;
> while($cursor < length $source) {
> my $chunk = substr($source, $cursor, $step);
> unless($step == length $chunk) {
> $target .= $chunk;
> last;
> }
> $target .= $chunk . $insert;
> $cursor += $step;
> }
>
> print "Original: $source\nTransformed: $target\n";
You're basically splitting the string into substrings of length <=
$step and joining them back with $insert between them. Perl has high
level functions that do this. A regex, or unpack, can do the splitting
and join can insert the fixed part:
my $target = join $insert, $source =~ /.{1,$step}/g;
or
my $target = join $insert, unpack "(a$dist)*", $source;
On a different note, running through the insertion points backward, one
can insert the fixed string directly:
$target = $source;
substr( $target, $_, 0) = $insert for reverse
map $_*$step, 1 .. length( $target)/$step;
Anno
------------------------------
Date: Sat, 05 Mar 2005 22:01:32 GMT
From: Jazeker <jazeker_b_nospamlalala@yahoo.co.uk>
Subject: file locking : does the os do this ?
Message-Id: <0%pWd.30367$Bg.3090525@phobos.telenet-ops.be>
Hello,
This question may be a bit out of scope. Just let me know.
I have some Perl/CGI scripts that write to/read from a text file. 'till
now, I always assumed that when you open a file for writing, the OS will
not allow another instance of the script to do the same (via refusing or
making it wait, ...) and that the Perl programmer should not be
concerned with that. I have seen that Perl offers locking mechanisms,
but I usually see them in the context of random I/O file handling (and
IIRC in binary mode).
Am I wrong and do I have to include file locking in my script when using
the usual simple text file handling like :
open (TEST, "> test.txt") || die "Error opening test.txt";
print TEST "hello";
close TEST || die "Error opening test.txt";
Sorry for the somewhat off-topicness of this message... just a link to
a better newsgroup or a good read will suffice then :-)
thx
--
print <<EOF;
Just a noobish Perl hacker
EOF
------------------------------
Date: Sat, 05 Mar 2005 17:34:52 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: file locking : does the os do this ?
Message-Id: <7IOdneuvR_GRqbffRVn-uA@comcast.com>
Jazeker wrote:
> Hello,
>
> This question may be a bit out of scope. Just let me know.
>
> I have some Perl/CGI scripts that write to/read from a text file. 'till
> now, I always assumed that when you open a file for writing, the OS will
> not allow another instance of the script to do the same (via refusing or
> making it wait, ...)
Depends on the OS and file system, but generally, no, the OS will assume
you know what you're doing and allow the simultaneous access.
> and that the Perl programmer should not be
> concerned with that. I have seen that Perl offers locking mechanisms,
> but I usually see them in the context of random I/O file handling (and
> IIRC in binary mode).
>
> Am I wrong and do I have to include file locking in my script when using
> the usual simple text file handling like :
> open (TEST, "> test.txt") || die "Error opening test.txt";
> print TEST "hello";
> close TEST || die "Error opening test.txt";
It depends on whether you expect other scripts or programs to be using
test.txt. If you *are* expecting this, you'll need to use flock.
>
> Sorry for the somewhat off-topicness of this message... just a link to
> a better newsgroup or a good read will suffice then :-)
>
> thx
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: 5 Mar 2005 14:03:17 -0800
From: "AJ Hartley" <ajperl@mac.com>
Subject: Re: Looping through a log file
Message-Id: <1110060197.523869.221760@g14g2000cwa.googlegroups.com>
Thanks for your reply. It appears to be just the push the I needed.
I'll begin hammering this out this evening!
------------------------------
Date: 5 Mar 2005 11:18:23 -0800
From: mortgages2005@aol.com
Subject: Need to download exact copy of text file...little squares replace carriage returns
Message-Id: <1110050303.072893.58750@g14g2000cwa.googlegroups.com>
I need to download a text file from my server. I've tried to use a
program to email it and another to make the browser download the file
with a file save as dialog. The text file has a few charaters and then
some spacing, as many as 120 spaces following by a new line. (line
feed carriage return) I hear unix or linux stores a new line as a line
feed only. After the file is saved to my hard disk through the save
file routine, I should be able to open it up in notepad and not see a
whole bunch of little squares which replaced all the carriage returns.
I need an exact copy of the file as it is correctly saved on the
server. I know it is correct because I'm able to drag it from my FTP
client into my local browser and it opens up in notepad without the
little squares. I can also even right click on the file on my server,
and do view the file, which will transer it over to my computer, open
it in notepad, and there won't be any square boxes replaceing the
carriage returns.
Why is it when I save a file this happens? Is it my browser settings?
I've tried two browsers. They both do the same thing.
Here is the code:
#!/usr/bin/perl
use CGI ':standard';
use CGI::Carp qw(fatalsToBrowser);
my $files_location;
my $ID;
my @fileholder;
my $subdirectory=param('subdirectory');
$ID = param('ID') . "du.txt";
$files_location = "/home/mortga20/public_html/$subdirectory/";
#print "Content-type: text/html\n\n";
#print "files_location is " . $files_location;
#exit;
if ($ID eq '') {
print "Content-type: text/html\n\n";
print "You must specify a file to download.";
exit;
}
open(DLFILE, "<$files_location/$ID") || Error('open',
'$files_location/$ID');
print header( -type => 'application/x-download',
-attachment => $ID,
);
print $_ while (read(DLFILE, $_, 1024));
close (DLFILE) || die ("Can't close file!");
open(LOG, ">>/home/mortga20/public_html/$subdirectory/log.txt") || die
("Can't open file!");
print LOG "$ID\n";
close (LOG);
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$ID\n\n";
print @fileholder
------------------------------
Date: Sat, 05 Mar 2005 20:40:01 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Need to download exact copy of text file...little squares replace carriage returns
Message-Id: <38ug5oF5spt74U1@individual.net>
mortgages2005@aol.com wrote:
> I hear unix or linux stores a new line as a line
> feed only. After the file is saved to my hard disk through the save
> file routine, I should be able to open it up in notepad and not see a
> whole bunch of little squares which replaced all the carriage returns.
Yes, you see those squares when you view a Unix formated file in Notepad.
> I need an exact copy of the file as it is correctly saved on the
> server.
But that is contradictory. If you want it to make sense when viewed in
Notepad, then you actually want to convert it to Windows format.
perldoc -f binmode
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 05 Mar 2005 14:08:38 -0700
From: Aaron Dalton <aaron@daltons.ca>
Subject: PerlMagick, Annotate, and Webdings
Message-Id: <d0d746$kr5$1@news.ucalgary.ca>
I am trying to Annotate an image with a character from the Webdings
font. I am running on a FreeBSD 5.3 box and all appropriate libraries
are installed. I can Annotate just fine with say an Arial font, but
when I want a special character from Webdings, it doesn't work. Below
is a code snippet:
use Image::Magick;
my $img = Image::Magick->new(size=>'100x100');
$img->Read('xc:white');
$img->Annotate(text=>"\x{00e9}",
font=>'/home/html/games/data/webding.ttf', pointsize=>136,
stroke=>'black', encoding=>'UTF-8', gravity=>'Center');
$img->Write(filename=>'png:test.png');
Now, you *should* get an upward-pointing arrow. But instead I get an
accented lowercase 'e'. What am I doing wrong?
Thank you so much for your time and assistance.
Aaron
------------------------------
Date: Sat, 5 Mar 2005 21:21:50 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: PerlMagick, Annotate, and Webdings
Message-Id: <Pine.LNX.4.61.0503052111370.22888@ppepc56.ph.gla.ac.uk>
On Sat, 5 Mar 2005, Aaron Dalton wrote:
> I am trying to Annotate an image with a character from the Webdings
> font.
Although I'm not familiar in details with the specific software you're
trying to use here, if it's Unicode-supporting software then that's
almost certainly irrelevant. Of more interest is - what's its Unicode
value?
> $img->Annotate(text=>"\x{00e9}",
That character is authoritatively e-acute in Unicode. If you find
Unicode-supporting software which displays anything else, it's in a
state of sin.
> Now, you *should* get an upward-pointing arrow.
No, you *should* get e-acute. If your Webdings font doesn't contain
an e-acute then it's counterproductive to ask for it, but the software
should have some kind of fallback whereby it'll go and find another
font which -does- contain it.
> But instead I get an accented lowercase 'e'.
So it's working!
> What am I doing wrong?
You're failing to specify the Unicode character for upward arrow.
Possibly it's \x{2191} that you're looking for, but feel free to
browse around the Unicode database. Or if you want it in HTML, I have
a version at http://ppewww.ph.gla.ac.uk/~flavell/unicode/
in this case I think you want something from the page
http://ppewww.ph.gla.ac.uk/~flavell/unicode/unidata21.html
good luck (this isn't really a Perl problem, though).
------------------------------
Date: 5 Mar 2005 20:02:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: print isn't flashed using PERL by MSWin32 on Windows XP
Message-Id: <d0d391$jun$1@mamenchi.zrz.TU-Berlin.DE>
A. Sinan Unur <1usa@llenroc.ude.invalid> wrote in comp.lang.perl.misc:
> "reyal" <e_rozenblat@hotmail.com> wrote in
> news:1110029222.643082.61680@f14g2000cwb.googlegroups.com:
[eof() with a terminal]
> So, the culprit seems to be the call to eof.
>
> Now, the documentation of eof does indeed state that it is not very
> useful in an interactive setting, and I do not think I have a line of
> code anywhere with a call to eof in it (be it C, Java or Perl). Granting
> that, I am still a little confused about this behavior.
It appears to be consistent with the fact that eof() hangs until a
character of input is available. It doesn't consume a character,
but since on a terminal the eof condition is represented as a character
it must look at one, so wait for one.
Anno
------------------------------
Date: 05 Mar 2005 22:26:29 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: qx, Filter::Simple, and testing
Message-Id: <slrnd2kcgl.v9v.abigail@alexandra.abigail.nl>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMCCIV
September MCMXCIII in <URL:news:d0au0t$dkk$1@mamenchi.zrz.TU-Berlin.DE>:
-- Abigail <abigail@abigail.nl> wrote in comp.lang.perl.misc:
-- >
-- > I'm working on a module that uses source filtering, using Filter::Simple.
-- > One of the things it does is replacing certain constructs inside double
-- > quoted environments, like "", qq {}, etc. Testing "", s///, m//, qq{}
-- > is fairly straightforward.
-- >
-- > I'm looking for ideas on how to test qx{} (and ``). It should work on
-- > any platform Perl works on, and it should be safe.
--
-- So you want something that can be safely executed on every system that
-- runs Perl (whatever "execute" means on that system). Is that what you're
-- getting at? If not, apologies.
Yes.
-- Could the filter action be tested without actually executing the result?
I don't know. If I knew a way, I wouldn't have asked the question.
-- Otherwise, I only see the straight-and-narrow way: Build a hash of
-- command strings keyed by $^O.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
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 7861
***************************************