🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #5068

perl question about > in file name

#5068
From: Don Winsor
Date: Sun, 04 Jun 1989 19:36
19 lines
1396 bytes
Does anyone know if there is any way to make "perl" read from a
file whose name begins with a ">" character?  This question arose
from a discussion I was had about whether a perl script could
replace a C program for some simple operations on arbitrarily
named files.  At first, I though it could, but then this issue of
files with names beginnning with characters in the set [<>|+] came
up.  I know this is a strange and rare situation, but I'd like to
be able to handle it should it arise.  The "perl" manual says:

    If the filename begins with <" or nothing, the file
    is opened for input.  If the filename begins with
    ">", the file is opened for output.  If the filename
    begins with ">>", the file is opened for appending.

This seems to preclude any nice way to access files whose names
may contain arbitrary characters.  Is there any way around this?

Don Winsor, Systems Programmer, University of Michigan Department of
Electrical Engineering and Computer Science, don@dip.eecs.umich.edu
Technical Details
Message-ID: <123@zip.eecs.umich.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!tank!eecae!shadooby!mailrus!umich!don

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!tank!eecae!shadooby!mailrus!umich!don
From: don@zippy.eecs.umich.edu (Don Winsor)
Newsgroups: comp.sources.d
Subject: perl question about > in file name
Keywords: perl
Message-ID: <123@zip.eecs.umich.edu>
Date: 4 Jun 89 19:36:30 GMT
Organization: University of Michigan EECS Dept., Ann Arbor
Lines: 19