Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I don't use Terminal much, I prefer iTerm. But, for Terminal:

    use Cwd;
    use Mac::Glue;
    (my $cwd = cwd()) =~ s/'/'\\''/g;
    my $term = new Mac::Glue 'Terminal';
    $term->do_script(with_command => "cd '$cwd'");

    For iTerm:

    my $iterm = new Mac::Glue 'iTerm';
    my $term = $iterm->make(new => 'terminal');
    $term->Launch(session => 'default');
    $term->obj(session => 1)->write(text => "cd '$cwd'");