Active Now

Malizz
Danilo_G
Discussion » Questions » Food and Drink » Do you know of any recipes that call for tildes?

Do you know of any recipes that call for tildes?

(I'm asking for a friend.)
~

Posted - December 9, 2016

Responses


  • Spotted tilde, tilde-in-the-hole, tildès en croute, tilde au vin, stuffed tilde ...
      December 9, 2016 5:53 AM MST
    2

  • 6988
    Certain noodle soups.
      December 9, 2016 1:12 PM MST
    1

  • 17261
    Found in Perl Cookbook:

    7.3. Expanding Tildes in Filenames

    Problem

    You want to open filenames like ~username/blah, but open doesn't interpret the tilde to mean a home directory.

    Solution

    Expand the filename manually with a substitution:

    $filename =~ s{ ^ ~ ( [^/]* ) }
                          { $1
                                    ? (getpwnam($1))[7]
                                    : ( $ENV{HOME} || $ENV{LOGDIR}
                                           || (getpwuid($>))[7]
                                        )
    }ex;


    Discussion

    The uses of tilde that we want to catch are:

          ~user
          ~user/blah
          ~
          ~/blah

    If no name follows the ~, the current user's home directory is used.

    This substitution uses /e to evaluate the replacement as Perl code. If a username follows the tilde, it's stored in $1, which getpwnam uses to extract the user's home directory out of the return list. This directory becomes the replacement string. If the tilde was not followed by a username, substitute in either the current HOME environment variable or the LOGDIR one. If neither of those environment variables is valid, look up the effective user ID's home directory.

      December 9, 2016 1:16 PM MST
    1

  • 5455
    Bacon-Wrapped Jalapeño Poppers!

    Mmm, tasty!

    This post was edited by Livvie at December 10, 2016 6:26 AM MST
      December 10, 2016 12:03 AM MST
    3