Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Re: Here, doccy doccy. nice doccy. heredoc, treat.

by particle (Vicar)
on Jun 22, 2001 at 00:40 UTC ( #90527=note: print w/replies, xml ) Need Help??

in reply to Re: Here, doccy doccy. nice doccy. heredoc, treat.
in thread Here, doccy doccy. nice doccy. heredoc, treat.

hey, i just noticed something in my output from running 'date' in a heredoc on Win32. look closely at the output:
The current date is: Thu 06/21/2001 Enter the new date: (mm-dd-yy) date
when date is run from the command line, the output is:
The current date is: Thu 06/21/2001 Enter the new date: (mm-dd-yy)
so why does date (the contents of $foo) appear when run from a heredoc with backtick interpolation? this seems to be more than just a fancy way of quoting. can someone verify this behaviour on *nix?

curiouser and curiouser...


Replies are listed 'Best First'.
Re: Re: Re: Here, doccy doccy. nice doccy. heredoc, treat.
by Vynce (Friar) on Jun 22, 2001 at 01:18 UTC

    well, if you've copy-pasted my version, you'll note that after printing `date`, it prints "date" -- which would make it appear to be right after the backticked version. move the IMPLIED heredoc to before the BACK heredoc aand you should see that change.

    also, my version of date and yours are different; mine doesn't ask for the new date if called with no arguments. sorry for the inconvenience; i hope i didn't make your machine forget the date.

      aah, you are correct.
      for a moment i thought some how the things were screwy, but it was just the perl interpreter in my head (it's still in beta).

      no inconvenience on the date thing. that's a function that goes back to the first version of DOS i used, and that was made by IBM. when NT 3.0 rolled around, they finally updated the function with a -T option to display only, and not prompt.anyway, this heredoc stuff piqued my interest, since i'd been following a bit of chatterbox today as well.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://90527]
[GotToBTru]: un less you're working on write-only memory
[1nickt]: my $x = $aohoaoh->[0]->{' foo'}->[0]->{'bar' }; should work
[thepkd]: not indexing
[thepkd]: getting data out of the ds
[choroba]: it depends. Give more details, please
[thepkd]: i used a series of {}'s but it dont work
[choroba]: You need square brackets for arrays
[GotToBTru]: you can certainly construct a single expression to access any part of the data structure, without using temp variables. but you might make it easier on yourself and any other poor soul who has to understand your code if you do
[thepkd]: to dereference i mean
LanX .oO( oh tempz, oh moretz)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2016-12-06 13:21 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (104 votes). Check out past polls.