Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Devel::REPL re.pl re.bat win32 output trimmed / chopped / drivename stripped

by Anonymous Monk
on Oct 06, 2013 at 00:42 UTC ( #1057096=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Running Devel::REPL's re.bat which is all deafults
$ Cwd::cwd() $ /yummy/fudge $ $ print Cwd::cwd(),$/ C:/yummy/fudge $ $ Data::Dump::Streamer::Dump( Cwd::cwd() ) $VAR1 = 'C:/yummy/fudge'; $ [ Cwd::cwd() ] $ARRAY1 = [ 'C:/yummy/fudge' ]; $ ( Cwd::cwd() ) $ /yummy/fudge $ exit

Why is "C:/" getting eaten?

Comment on Devel::REPL re.pl re.bat win32 output trimmed / chopped / drivename stripped
Download Code
Re: Devel::REPL re.pl re.bat win32 output trimmed / chopped / drivename stripped
by marinersk (Curate) on Oct 06, 2013 at 03:10 UTC
    At a guess, it is getting eaten because it is a Windows-specific construct in a module which doesn't fully compensate for the Windows approach to current working directory.

    In my early days of Perl on Windows, I found a lot of the modules didn't quite handle the Windows-unique stuff as gracefully as I'd like, and so I wound up writing modules for myself to compensate.

    Also, you look to be doing things in a more Linux-y environment that seem to be Windows-esque. Are you running under Cygwin?

    I seem to recall some special kinds of weirdness can happen when running under Cygwin which exceed even the Windows/Linux weirdness matrix.

    Been a long time since I've used those environments, and the modules I rolled for myself over a decade ago still serve me well, so I haven't revisited these kinds of issues in a very long time.

    Hope someone gives you better insight, but I can't tell from you snippet above exactly how to reproduce your problem, much less resolve it.

    Here's hoping a more familiarized Monk recognizes what you're doing.

    If you'd like, I suppose I could post what I use to get and set current working directory, but I really don't know if it's all that robust -- or even as portable as I'd like.

    Let's first see what others come up with.

Re: Devel::REPL re.pl re.bat win32 output trimmed / chopped / drivename stripped
by Athanasius (Abbot) on Oct 06, 2013 at 03:33 UTC

    FWIW, I can’t reproduce this problem running Strawberry Perl under 32-bit Vista:

    13:23 >re $ Cwd::cwd() C:/yummy/fudge $ print Cwd::cwd(),$/ C:/yummy/fudge 1 $ Data::Dump::Streamer::Dump( Cwd::cwd() ) $VAR1 = 'C:/yummy/fudge'; $ [ Cwd::cwd() ] $ARRAY1 = [ 'C:/yummy/fudge' ]; $ ( Cwd::cwd() ) C:/yummy/fudge $ exit 13:25 >perl -v This is perl 5, version 18, subversion 1 (v5.18.1) built for MSWin32-x +86-multi-thread-64int ... 13:25 >pmvers Devel::REPL 1.003025 13:25 >

    Are you perhaps running an earlier version of Devel::REPL?

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      I just got it

      $ pmvers Devel::REPL 1.003025

      update : I had set term=dumb , unsetting this failsafe setting seems to get normal desired behaviour like you see

      "uninstalling" Term::ReadLine::Perl confirms its a Term::ReadLine::Perl related

Re: Devel::REPL re.pl re.bat win32 output trimmed / chopped / drivename stripped (\r)
by tye (Cardinal) on Oct 06, 2013 at 05:06 UTC

    Nothing is getting eaten. Pay closer attention. Look at just the two output lines:

    $ /yummy/fudge C:/yummy/fudge

    "C:" wasn't removed. It was overwritten by '$ '. So you had a "\r" but no "\n" between the output and the next '$ ' prompt. My guess is that the prompt is "\r$ " and one form of output has no newline on the end.

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1057096]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-07-04 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls