Professional Web Applications Themes

Inline Edit -- File name - PERL Beginners

How will I get the file name when I do an inline edit like this: perl -i.orig -pe '$_ = <filename> $_' filename How would I get the file name in <filename>? Thanks, Rex...

  1. #1

    Default Inline Edit -- File name

    How will I get the file name when I do an inline edit like this:

    perl -i.orig -pe '$_ = <filename> $_' filename

    How would I get the file name in <filename>?

    Thanks,
    Rex
    RArul@newenergyassoc.com Guest

  2. #2

    Default RE: Inline Edit -- File name

    Well, I did try that with $ARGV[0], but to no avail. Yes, I had posted a POC. Here is the true code that would not print the file-name. What am I doing wrong?

    perl -pe '$_ = "$ARGV[0] \t $_"' trace.txt



    -----Original Message-----
    From: Jose Alves de Castro [mailto:di.uminho.pt]
    Sent: Wednesday, September 22, 2004 12:40 PM
    To: Arul, Rex
    Cc: org
    Subject: Re: Inline Edit -- File name

    On Wed, 2004-09-22 at 15:24, com wrote: 

    That won't compile, but I believe you're posting something like a proof
    of concept rather then code...

    If I get this correctly, you're looking for the $ARGV variable. Check
    out:

    perldoc perlvar
     
    --
    Josť Alves de Castro <org>
    http://natura.di.uminho.pt/~jac

    RArul@newenergyassoc.com Guest

  3. #3

    Default RE: Inline Edit -- File name

    Thanks for the help.

    This works: perl -pe '$_ = "$ARGV \t $_"' trace.txt
    This doesn't: perl -pe '$_ = "$ARGV[0] \t $_"' trace.txt

    perldoc perlvar says that $ARGV must be used for command-line processors
    and in array-context as ARGV for running scripts.

    Thanks, once again.


    -----Original Message-----
    From: Arul, Rex
    Sent: Wednesday, September 22, 2004 1:27 PM
    To: 'di.uminho.pt'
    Cc: org
    Subject: RE: Inline Edit -- File name

    Well, I did try that with $ARGV[0], but to no avail. Yes, I had posted a
    POC. Here is the true code that would not print the file-name. What am I
    doing wrong?

    perl -pe '$_ = "$ARGV[0] \t $_"' trace.txt
    RArul@newenergyassoc.com Guest

Similar Threads

  1. Can't edit a .SWF file
    By Duncs in forum Macromedia Flash
    Replies: 9
    Last Post: January 2nd, 11:39 AM
  2. How to edit a swf file
    By ladyluck21 in forum Macromedia Flash Sitedesign
    Replies: 3
    Last Post: May 4th, 07:31 PM
  3. Turn editable cols on/off in single row inline edit
    By aimee in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: October 29th, 05:38 PM
  4. [PHP-DEV] [PATCH] inline -> static inline
    By Sascha Schumann in forum PHP Development
    Replies: 0
    Last Post: August 15th, 09:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139