Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Unable to connect to some SFTP servers using Perl::SFTP

by salva (Abbot)
on Apr 09, 2013 at 09:02 UTC ( #1027682=note: print w/replies, xml ) Need Help??

in reply to Re^2: Unable to connect to some SFTP servers using Perl::SFTP
in thread Unable to connect to some SFTP servers using Perl::SFTP

If you only need to run your script on Linux/Unix systems, then, consider using processes (via fork) instead of threads.

Replies are listed 'Best First'.
Re^4: Unable to connect to some SFTP servers using Perl::SFTP
by skylinedreamer (Novice) on Apr 12, 2013 at 02:45 UTC
    I enabled forks as follows by using system call to create a new terminal to run each ftp/sftp connection in a seperate perl script. It's able to execute but I am having issues when my parameters(@fields) contain bracket. I am not able to pass parameters which contains bracket.
    unless (fork()) { system("xterm -T $fields[0] -e \.\/uploader\.pl $index @field +s"); exit(0); }
    Error msg
    sh: syntax error at line 1: `(' unexpected
    After executing the window closes automaticaly. Is there a way to make it halt until the user press a key to exit or so. I tried to have a  <> at the end of the uploader script. But doesn't help
      Found a solution for the terminal to wait for user input from
      system("gnome-terminal -x bash -c './ $index @fields; read +-n1'");
      But still I am not sure on how to fix the bracket issue.
        The brackets are being intercepting by the shell. You have to properly quote shell metacharacters... actually, as there are two shells being invoked (the one used by perl to run your command and the one you are calling explicitly), you will have to double quote your arguments.

        If you want to follow that route and need help about quoting I advice you to post a new question.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027682]
Tanktalus is trying to figure out how to get a case-insensitive match between stra▀e and strasse to return true in perl :( fc doesn't seem to do it, either, unless I'm doing it wrong.
[LanX]: ▀,ss
[LanX]: nope
[LanX]: /.*(?:▀|ss).*/
[hippo]: How are you doing the match? Regex, index, eq or something else?
[choroba]: fc $s1 eq fc $s2 I guess
[Tanktalus]: hippo: I don't care, I just want to prove it can match correctly compared to, say, ILIKE / UPPER / LOWER in postgres :)
[LanX]: is there a unicode convention that ▀ is ss ?
[Tanktalus]: LanX: yes :) I haven't tried java, but I have this match working in its bastard cousin, C# :) I just thought perl's unicode support would get me there :)
[LanX]: I have my doubts, IMHO its a workaround if the glyph is missing

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2018-03-21 15:40 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (268 votes). Check out past polls.